Problem Solving and Algorithmic Thinking
Problem Solving and Algorithmic Thinking
This domain tests how a problem is analysed and expressed before coding: input, processing and output, algorithm properties, flowcharts, pseudocode and desk checking.
Core rules
- An algorithm is a finite, ordered set of unambiguous steps that accepts input, produces output and terminates.
- Flowchart symbols: oval for start or stop; parallelogram for input or output; rectangle for process; diamond for decision; arrows for flow; circle for a connector.
- Pseudocode uses structured English with IF...THEN...ELSE, WHILE...ENDWHILE, FOR...ENDFOR, and READ or PRINT.
- Selection chooses one path; iteration repeats while a condition is true; sequence runs steps in order.
- Desk checking traces variable values step by step to verify logic before programming.
- A good algorithm should be correct, finite, unambiguous and efficient enough for the problem.
Worked example
Find the largest of three numbers A, B and C. READ A, B, C SET max = A IF B > max THEN max = B IF C > max THEN max = C PRINT max Reasoning: initialise max to the first value, then compare each remaining value once. For A=7, B=12 and C=9, max becomes 7, then 12 because B > 7, then stays 12 because 9 > 12 is false. The output is 12. Each comparison is necessary; skipping the initialisation leaves max undefined.
Traps
- A decision needs a yes-or-no condition; a process box cannot branch.
- Loops need a changing condition; otherwise they never terminate.
- Reading output before all inputs are processed gives wrong traces.
- A flowchart must have a clear start and at least one stop; dangling arrows lose marks.
- Do not confuse a connector with a terminator: the circle links parts of the chart.