Algorithms, explained without the jargon.
An algorithm is a finite sequence of clear steps used to solve a problem or complete a task. You already use algorithms when you follow a recipe or work through a calculation.
Start with input, process and output
Consider a program that calculates a student’s average score. The inputs are the scores, the process adds them and divides by their count, and the output is the average.
INPUT score1, score2, score3 SET total = score1 + score2 + score3 SET average = total / 3 OUTPUT average
Three building blocks
Sequence means following instructions in order. Selection means choosing a path based on a condition. Iteration means repeating instructions.
For example, a program first reads a score. It then checks whether the score is at least 50 and displays a result. To process a whole class, it repeats those steps for each student. Here, 50 is an example threshold, not an official grading rule.
Make instructions precise
“Calculate the result” is vague. “Add the three scores and divide the sum by three” specifies what to do. A useful algorithm also defines what happens when an input is missing or outside the accepted range.
Try it yourself
- Write five to eight steps for borrowing a book from a school library.
- Add a decision for when the book is unavailable.
- Identify the input and output.
- Ask someone to follow your steps without extra explanation.
Keep exploring
More practical guides ↗These introductory guides support learning and do not replace an institution’s approved syllabus.
