Algorithms and Their Properties
An algorithm is a finite, precisely specified sequence of executable steps for solving a computational problem.
Summary
An algorithm is a finite, precisely specified sequence of executable steps for solving a computational problem. Its input-output contract specifies valid inputs, preconditions, and required results. It may accept zero or more inputs but must produce at least one result.
Definiteness requires unambiguous operations and decisions. Effectiveness requires each basic operation to be executable in finite time using the computational model's available operations. Finiteness requires the entire procedure to terminate for every valid input.
| Concept | What it establishes |
|---|---|
| Partial correctness | The required result is produced if execution terminates. |
| Total correctness | Partial correctness plus guaranteed termination for every valid input. |
| Efficiency | How time and memory requirements scale with input size. |
Time complexity describes computational work; space complexity describes memory requirements. Big-O notation gives an asymptotic upper bound on resource growth; denotes a linear upper bound in input size . Resource-growth analysis supports algorithm selection beyond small test cases, while precise specifications support consistent implementation across programming languages.
🧠 Key Concepts
- Input-output contract
- Definiteness
- Finiteness
- Effectiveness
- Preconditions and postconditions
- Partial correctness
- Total correctness
- Time and space complexity
- Big-O notation
🧠 Quick Check
See what you remember from the summary.
What should an algorithm's input-output contract establish?
🧠 Flashcards Preview
Tap a card to reveal the definition.
Ready to quiz yourself?
Test what you remember with a full practice quiz on this note. Create a free account and start in seconds.
Full Notes
Read the original note content before deciding whether to save or study from it.
Algorithms and Their Properties
📘 Overview An algorithm is a finite, precisely specified sequence of effective steps for solving a computational problem. Its specification defines valid inputs and required outputs, while correctness and efficiency determine whether it solves the problem reliably and with acceptable resource use.
🧠 Key Idea An algorithm must terminate and produce the required result for every valid input. Correctness concerns the result; efficiency concerns the time and memory needed to obtain it.
⚔️ Core Details: - Input-output contract: An algorithm specifies zero or more inputs and at least one result satisfying the problem's requirements. - Definiteness: Every operation and decision has a precise meaning. - Finiteness: Execution terminates after a finite number of steps for every valid input. - Effectiveness: Each basic operation is executable in finite time using the computational model's available operations. - Correctness: The algorithm satisfies its output specification for every input meeting its preconditions. - Efficiency: Time complexity and space complexity describe how computational work and memory requirements scale with input size.
🎯 Why It Matters: - Explicit input and output contracts expose assumptions that could otherwise cause failures on empty, boundary, or malformed inputs. - Separating correctness from efficiency prevents a fast but incorrect implementation from being accepted as a valid solution. - Resource-growth analysis supports algorithm selection when input sizes become too large for small test cases to represent performance. - Precise algorithm descriptions support implementation in different programming languages without changing the intended computation.
🧠 Quick Recall: - Algorithm - A finite, precisely specified procedure composed of executable steps for solving a computational problem. - Precondition and postcondition - A required condition before execution and a guaranteed condition after successful completion. - Partial correctness - The required result is produced if execution terminates. - Total correctness - Partial correctness together with guaranteed termination for every valid input. - Big-O notation - An asymptotic upper bound on resource growth;
More ways to study when you copy this note
Copy this note into your library to unlock focused practice sessions and long-term review.
Answer all questions first, then see feedback at the end — the way real exams work.
Focuses each session on what you got wrong, not what you already know.
Full timed exam with all questions, no pausing, and results at the end. Built for board exam prep.
Part of 🗄️ BS Information Systems — 1st Year
Browse this Review Set →More Computer Science notes
See all →More in Programming Fundamentals
See all →More from NoteLib
Browse NoteLib's public notes →Copy this note to your library and get the full Study Pack instantly — summary, key concepts, and practice quiz included.