Skip to main content
SingaporeComputer Science

O-Level Computing (7155) Algorithms and Problem Solving: flowcharts, pseudocode, searching, sorting, and trace tables

A module overview for O-Level Computing (SEAB 7155) Algorithms and Problem Solving: how to define and draw an algorithm with flowcharts and pseudocode, trace and compare linear and binary search, trace a bubble sort, and use trace tables with normal, boundary and invalid test data for the lab-based Paper 2.

Generated by Claude Opus 4.88 min readSEAB-7155

Reviewed by: AI editorial process; not yet individually human-reviewed

Jump to a section
  1. Why this module matters
  2. Defining and drawing algorithms
  3. Searching: linear and binary
  4. Sorting: the bubble sort
  5. Trace tables and testing
  6. How this module is examined
  7. Check your knowledge

Why this module matters

Algorithms and Problem Solving is the analytical heart of O-Level Computing (SEAB 7155). Every program you write in the lab-based Paper 2 starts as an algorithm: a precise, finite set of steps that solves a problem. This module teaches you to express an algorithm clearly (as a flowchart and as pseudocode), to design and trace the standard searching and sorting algorithms, and to test your work systematically with a trace table and well-chosen test data. These skills are examined in Paper 1 on paper and put to work in Python in Paper 2, so they sit underneath everything else you do.

This guide ties together the matching dot-point pages, each with its own worked detail and practice. The strands below build on each other.

Defining and drawing algorithms

An algorithm is a finite sequence of unambiguous steps that solves a problem or completes a task. The first skill is to represent that sequence, and the two standard forms are flowcharts and pseudocode.

A flowchart is a diagram of the algorithm. See algorithms and flowcharts for the standard symbols: the terminator (start and stop), the parallelogram (input and output), the rectangle (a process or assignment), and the diamond (a decision). Arrows join the symbols to show the order, and the diamond is how you draw selection and iteration.

The written form is pseudocode. See pseudocode fundamentals for how to write input, output and assignment, and how to build selection with IF and iteration with WHILE and FOR. Pseudocode is language independent but maps cleanly onto Python, which is why it is the natural bridge to Paper 2.

The three building blocks of any algorithm are sequence (steps in order), selection (choosing a path with IF), and iteration (repeating with WHILE or FOR). Once you can express these three in both a flowchart and pseudocode, you can describe any algorithm in the syllabus.

Searching: linear and binary

Searching means finding whether (and where) a value appears in a list. See searching algorithms for the two you must know.

Linear search checks each item in turn from the start until it finds the target or reaches the end. It works on any list, sorted or not, but on a list of nn items it may need up to nn comparisons.

Binary search is faster but needs a sorted list. It compares the target with the middle item, then discards the half that cannot contain it, and repeats on the half that remains. Each step halves the search space, so it reaches the answer in far fewer comparisons. The discard step only works on a sorted list, because only then does smaller or larger than the middle tell you which half to keep.

Sorting: the bubble sort

Sorting puts a list into order, and the syllabus algorithm is the bubble sort. See sorting algorithms for the full method. The bubble sort makes repeated passes through the list, comparing each adjacent pair and swapping them if they are in the wrong order. After each pass the largest remaining value has "bubbled" to its correct position at the end, and the passes repeat until a pass makes no swaps, which means the list is sorted.

In an exam, show the list state after each pass (or after each swap) so the marker can follow your comparisons and swaps. That working earns the method marks even if you make a small slip.

Trace tables and testing

A trace table is how you check an algorithm by hand. See trace tables and testing for the technique: list the variables as columns and write each new value on a fresh row as you step through the algorithm, so you can see exactly how the values change and confirm the output.

Testing then needs the right data. Choose normal data (typical valid input), boundary data (values at the edge of what is allowed, where errors hide), and invalid data (input that should be rejected). Testing all three gives evidence the algorithm is correct, not just that it works on easy cases.

How this module is examined

  • Paper 1 (written, 60%). Draw and read flowcharts, write and complete pseudocode, trace searches and sorts step by step, and complete a trace table. Show your working at every stage to earn method marks.
  • Paper 2 (lab-based, 40%). Turn an algorithm into working, tested Python, using selection and iteration correctly, and validate it with normal, boundary and invalid test data.

Check your knowledge

Try these, then take the matching quiz for this module.

  1. State the three building blocks of any algorithm. (3 marks)
  2. Name the standard flowchart symbol used for a decision. (1 mark)
  3. State one reason binary search needs a sorted list. (1 mark)
  4. Define normal, boundary and invalid test data. (3 marks)

Sources & how we know this

  • computer-science
  • sg-o-level
  • seab-7155
  • o-level-computing
  • algorithms
  • flowcharts
  • pseudocode
  • searching
  • sorting
  • trace-tables
  • 2026