/en-tutor-prep-s2-ict-algorithms-flowcharts/
/en-tutor-prep-s2-ict-algorithms-flowcharts/
General Inquiry: info@TutorZone.com.hk
Office Hours: Monday to Saturday - 9:00 AM to 6:00 PM
WhatsApp Monday to Sunday - 24 hours
Hotline: +852 6828 1809
Instant Support: +852 9061 3106

Junior Secondary ICT (S2) | Algorithms and flowcharts prep guide (for tutors) | Search steps, flowchart symbols and sort comparisons

Junior Secondary ICT (S2) | Algorithms and flowcharts prep guide (for tutors) | Search steps, flowchart symbols and sort comparisons

  • 2026-11-21

Students write code before they ever count the steps. This lesson turns an algorithm into something countable: how many halvings, how many comparisons, and why speed does not remove the need for efficiency.

Objectives — Students can: (1) name the five flowchart symbols (terminator, process, decision, input or output, connector) and what each one does; (2) work out binary search steps by halving (4 steps for 16 items, 5 for 32, 10 for 1,000); (3) work out the average number of comparisons in a linear search (4.5 for 8 items); (4) use n(n-1)/2 to work out bubble sort comparisons (10 for 5 items, 28 for 8 items).

01 Prerequisites (3-minute check)

If any of these fails, fix it before the lesson starts.

Skill Quick check Pass mark
Powers What is 2 to the power 4? 16, so 16 items take at most 4 halvings
Ordering numbers Put 7, 3, 9 and 5 in ascending order 3, 5, 7, 9
Reading diagrams What does a diamond mean in a flowchart? A decision, answered yes or no

02 Lesson flow (60 minutes)

Time Stage Tutor does Student does
0-5 min Opening question Ask how many checks are needed to find one name among 1,000, one by one and then by halving, and write both estimates on the board Write their own two numbers and keep them for the end
5-20 min Act 1: flowchart symbols Draw oval, rectangle, diamond, parallelogram and circle, each with a daily-life example Match symbols to meanings and extend one flow with a decision
20-35 min Act 2: linear and binary search Demonstrate halving with 16 sorted cards and write 16, 8, 4, 2, 1 on the board Repeat with 32 cards and count 5 steps themselves
35-42 min Act 3: sorting comparisons Bubble sort 5 numbers and add the comparisons round by round to reach 10 Work out 6 comparisons for 4 numbers and 28 for 8 numbers
42-52 min Independent practice Circulate and only intervene when a decision is written as an action Finish three questions with the working shown
52-60 min Exit check Collect the three answers, mark them live, and re-teach that act next lesson if two are wrong Self-assess and note which act to review

03 Teaching script (read it out)

Scene 1: Five symbols and one definition

Start with the definition: an algorithm is a finite, clear, ordered set of steps that must stop. All four conditions matter, which is why “keep searching until you find it” is not an algorithm, since it may never stop. Then the five symbols: an oval marks start and end, a rectangle is a process that does something, a diamond is a decision that asks a yes or no question, a parallelogram is input or output, and a circle is a connector. Model the shortest possible flow: oval to start, parallelogram to input the score, diamond asking whether the score is at least 60, then a rectangle printing pass or fail, then oval to end.

A diamond holds one yes or no question, never an action.

Scene 2: Linear search and binary search

A linear search checks from the first item to the last, so 1,000 names take at most 1,000 checks and 500.5 on average, which makes 8 items average 4.5 checks. Binary search needs sorted data: check the middle item, discard the half that cannot contain the target, and repeat. Sixteen items become 8, then 4, then 2, then 1, so at most 4 steps; 32 items take 5 steps; 1,000 items take 10 steps because 2 to the power 10 is about 1,024. Stop here for the common misconception: students think binary search picks a random item, but every step must take the true middle, otherwise the step count is not guaranteed.

Binary search always throws away half, so the step count follows powers of two.

Scene 3: Bubble sort and comparison counts

Teach the countable version first: each pass compares neighbours from left to right and swaps when they are out of order, so the largest value is pushed to the right. Five numbers take 4 comparisons in the first pass, then 3, 2 and 1, giving 10; eight numbers take 7 plus 6 plus 5 plus 4 plus 3 plus 2 plus 1, which is 28; the formula is n(n-1)/2. Keep two counts apart: comparisons are how many pairs were tested, swaps are how many positions actually changed, and one pass can compare four times while swapping only once.

Comparisons use n(n-1)/2, swaps depend on the actual order, so they are different numbers.

04 Question types and worked steps

Type Example Steps Answer
Flowchart reading A diamond contains “score is at least 60”. Which symbol type is this? Check the shape, then decide whether the text is a question or an action Decision (condition) symbol
Binary search steps How many steps does binary search need for 32 sorted items? Write 32, 16, 8, 4, 2, 1 and count the arrows 5 steps
Linear search average How many comparisons does a linear search average over 8 items? Worst case 8, best case 1, then take the average 4.5
Bubble sort comparisons How many comparisons does bubble sort make on 5 numbers? Add 4, 3, 2 and 1, or use n(n-1)/2 10
Sanity check (teach this): Sanity check: binary search steps must be far below linear search steps, 10 against 1,000 for a thousand items, so an answer of 500 steps for binary search shows the student is still checking one by one. Comparison counts must also stay below n squared: 5 items give 10 comparisons, not 25.

05 Independent practice (3 questions)

Question Answer What to watch
How many steps does binary search need for 16 sorted items? Write the remaining count after each halving. 4 steps: 16, 8, 4, 2, 1 Whether the final single item is counted as a step
For 8 items, what are the best, worst and average comparisons in a linear search? Best 1, worst 8, average 4.5 Whether the average uses (1+8)/2 rather than dividing by 2
How many comparisons does bubble sort make on 4 numbers and on 8 numbers? 6 for 4 numbers and 28 for 8 numbers Whether the student uses n(n-1)/2 instead of n squared

06 Common mistakes and what to say

Mistake Student writes Say this
Writing a decision as an action The diamond says “calculate the total score” A diamond only asks a yes or no question. Calculations belong in a rectangle, and if the shapes are wrong the whole flow cannot be read.
Halving unsorted data Starting binary search on a list that has never been sorted Binary search assumes sorted data. Halving an unsorted list gives a wrong answer, so sort the list first and then take the middle.
Mixing comparisons and swaps Answering that bubble sort on 5 numbers swaps 10 times 10 is the comparison count. The swap count depends on the actual order, so keep the two numbers separate.
Assuming fast computers need no algorithm Saying a computer does billions of operations a second so checking one by one is fine Ten thousand items against a million is still two different worlds. A fast computer shortens the gap but does not remove it.

07 Homework (paper, section and question numbers)

08 Exit check (last 5 minutes)

Question Answer Decision
How many steps does binary search need for 32 sorted items? 5 steps (32, 16, 8, 4, 2, 1) If wrong, re-teach the halving demonstration in Act 2
What does a parallelogram mean in a flowchart? Input or output If wrong, re-teach the symbol table in Act 1
How many comparisons does bubble sort make on 4 numbers? 6 If wrong, re-teach n(n-1)/2 in Act 3

09 Tutor FAQ

Do S2 students need to memorise flowchart symbols?

They need to recognise the five basic shapes and their purpose. Fine detail of any national standard is unnecessary because questions ask what a symbol means or ask students to complete a flow.

Is 60 minutes enough for three acts?

Yes, if the demonstration is handed over: model 16 cards yourself and let students model 32. Explaining every symbol one by one always overruns.

Are there matching practice questions?

Yes. The homework section links to the matching paper and chapter index, with question numbers that follow the three acts.

Find a tutor — freeTutor Registration →

A TutorZone lesson-prep guide. Written by the TutorZone team; questions and lesson flow are original and are not taken from any school or publisher material.

Join as a tutor or coach — academic, music, sports, arts, STEM. Free to register. See how it works →