7.1 Algorithm design and problem-solving

Computational Thinking

Solving Complex Problems

Before writing code, a computer scientist must use two key techniques:

  • Decomposition: Breaking a complex problem down into smaller, manageable sub-problems (e.g., breaking a "Library System" into "Add Book", "Search", and "Borrow").
  • Abstraction: Removing unnecessary details to focus on the essential features (e.g., in a car simulation, we need the speed but not the color of the seats).
Concept Diagram
Figure 7.1.1: Computational Thinking

Flowchart Symbols

Standard Symbols

Cambridge requires specific shapes for flowcharts:

  • Terminator (Oval): Start and End.
  • Process (Rectangle): Calculations or assignments (e.g., x <- x + 1).
  • Input/Output (Parallelogram): Reading or printing data.
  • Decision (Diamond): Yes/No questions.
  • Subroutine (Double-edged Rectangle): Calling a pre-defined process.
Concept Diagram
Figure 7.1.2: Flowchart Symbols

Trace Tables

Tracing Algorithms

A trace table is used to track the values of variables as an algorithm runs. This helps identify logic errors.

Examiner Tip: Each time a variable changes, use a new row in the table. Do not overwrite values in the same cell.

This is essential for testing "Counting" and "Totalling" algorithms.

Concept Diagram
Figure 7.1.3: Trace Tables