algorithm
/ AL-go-rith-um /
An algorithm is a recipe for a computer. Think of a recipe for an omelette: a finite list of unambiguous steps that anyone can follow, in order, to turn the ingredients (the input) into the dish (the output). A good recipe never says "add a little salt and hope" — every step is clear enough that two cooks following it get the same result. An algorithm is exactly this kind of recipe, but for solving a computational problem rather than making breakfast.
More precisely, an algorithm is a finite, well-defined, terminating procedure that takes some input and produces the correct output. Pick that phrase apart. Finite: it is written down in a fixed, bounded number of instructions. Well-defined: each step is unambiguous, so there is no guessing about what to do next. Terminating: for every valid input it eventually stops, rather than looping forever. As a tiny example, to find the largest of a list of numbers you keep a running champion: start by calling the first number the champion, then walk through the rest, and whenever you meet a number bigger than the current champion, make that one the new champion; when the list runs out, the champion is the answer. That is an algorithm — finite, unambiguous, and it always stops.
Algorithms matter because they separate the idea of solving a problem from any particular machine, language, or programmer. The same "keep a running champion" method works in your head, on paper, in Python, or in hardware. This is why we study algorithms abstractly: a method that is fast and correct in the abstract stays fast and correct everywhere it is run. The word itself honours the 9th-century scholar al-Khwarizmi, whose name, Latinised, became "algorism" and then "algorithm."
Finding the maximum of [3, 9, 2, 7]: champion starts at 3; see 9 (bigger) -> champion 9; see 2 (not bigger) -> stay 9; see 7 (not bigger) -> stay 9; list ends -> answer 9.
Four steps, each unambiguous, and it stops — a complete algorithm.
An algorithm is not the same as a program. The program is one written-out implementation in some language; the algorithm is the underlying method, which you could implement in many languages or even carry out by hand.