Definition
Algorithm
An algorithm is a precise, repeatable set of steps and rules for solving a defined kind of problem.
What it means
An algorithm is more than a helpful idea. It tells you exactly what to do, in what order, including when to repeat a step and when to stop. The same algorithm can be used on many different starting inputs, not just one problem.
Remember it
Input → exact steps → output.
Example
To sort the cards 7, 2, 9, 4 from least to greatest: find the smallest remaining card and place it next; repeat until none remain. The cards are placed 2, then 4, then 7, then 9, so the output is 2, 4, 7, 9.
Watch for
“Work it out carefully” is advice, not an algorithm, because it does not give precise steps or a stopping rule.
Common mix-up
An algorithm does not have to be the quickest method; it must be precise enough to follow and dependable for its intended problems.
Exact meaning
An algorithm is a precisely described procedure made from a finite set of steps and rules for a defined class of inputs; when followed correctly for its intended inputs, it produces the required output and stops.