Computer Science glossary · Kindergarten to Grade 9
Algorithm
Also called: set of instructions
What it means
An algorithm is a set of clear, step-by-step instructions for solving a problem or finishing a task. The steps must be in the right order and precise enough that anyone, or any computer, can follow them.
Examples
- A recipe for making toast is an algorithm: get bread, put it in the toaster, push the lever, wait, take it out.
- Directions on a grid: move forward 2, turn right, move forward 3.
- A rule for sorting cards from smallest to largest is a sorting algorithm.
For teachers
An algorithm is the plan; a program is that plan written in a language a computer can run. Algorithms are built from three control structures: sequence, selection (decisions) and repetition (loops). Unplugged activities, such as writing instructions for a classmate to draw a shape or guide a robot through a grid, let students test whether their steps are precise and in order before they ever code.
Common misconception
Students often think algorithms are only something computers use, or that they must involve code. Any precise set of ordered steps is an algorithm, including a recipe or a dance routine; computers simply need algorithms to be written very exactly.
Lesson plans that teach it
- Unplugged Algorithms: Program the TeacherGrade 3 · free lesson plan with worksheet