Fun computer science · Classes 7 to 10

Algorithms: step-by-step thinking

An algorithm is a recipe a computer can follow exactly. Trace what it does one step at a time, and see why some recipes finish much faster than others.

1. Trace a loop

Set where x starts, what it adds each time and how many times the loop repeats. Predict the final x, then run it.

3. Bubble sort, pass by pass

Bubble sort compares neighbours and swaps those that are out of order. Press Next pass and watch the biggest number “bubble” to the end.

Common trap: Binary search only works on a sorted list. On an unsorted list, throwing away half the items could throw away the answer.

Remember in one minute

Practice now: 3 levels, worked answers, progress tracker →

This is a practice aid made by BodhiScore, not a textbook or an official board resource. Your school’s textbook decides the exact syllabus and the way answers are written. Nothing on this page is saved or sent anywhere. This is a practice aid, not a substitute for your school textbook. These are standard computing facts; where a value depends on a convention (such as 1 KB = 1024 bytes) the question says which one is used.

Share