Library › Computer Science 0478 › Algorithms
O Level · Computer Science 0478

Algorithms

Revise Algorithms for Computer Science 0478 (O Level) — revision notes and instant AI marking.

📖 Revision notes · preview
Cambridge IGCSE 0478 · Computer Science

Algorithms

An algorithm is just a precise, step-by-step recipe for solving a problem — and you can write that recipe as a diagram, a flowchart, or pseudocode.

Structure Diagrams Flowcharts Pseudocode
Summary — The Whole Chapter in One Glance
  • An algorithm is a precise set of instructions for solving a specific problem or task — precise means unambiguous, every step has exactly one meaning.
  • There are three ways examiners expect you to design/represent an algorithm: structure diagrams (top-down hierarchy), flowcharts (visual shapes + arrows), and pseudocode (structured English-like text).
  • Structure diagrams break a big system down into smaller and smaller sub-problems — like a family tree of tasks.
  • Flowcharts use specific shapes: ovals for start/stop, parallelograms for input/output, rectangles for processes, and diamonds for decisions — connected by arrows showing the flow of control.
  • Pseudocode is more structured than plain English but must never use real programming syntax like print() or semicolons — that loses marks in the exam.
  • To explain an existing algorithm, you look at its inputs, its processing steps, its outputs, and (for complex ones) any comments, its context, or you test it with sample data.
  • If a question just says "write an algorithm" with no format specified, default to pseudocode — it's faster and it's what examiners expect unless told otherwise.
1. What Is an Algorithm?

Think about a recipe for making toast: put bread in toaster → wait 2 minutes → take bread out → spread butter. That's an algorithm — it's a sequence of exact, unambiguous steps that, if followed correctly by anyone (or any computer), always solves the same problem the same way.

The exam definition is short but every word matters: an algorithm is a precise set of rules or instructions to solve a specific problem or task. "Precise" is the key word — vague instructions like "cook it until it's done" aren't an algorithm, because different people would interpret "done" differently. A real algorithm might say "heat for exactly 4 minutes at 200°C."

Algorithms don't have to be written as computer code. Before a programmer ever writes a line of Python or Java, they usually design the algorithm first using one of three tools, because it's much easier to spot logic mistakes in a diagram or in plain-ish English than buried inside code syntax:

The Three Ways to Design an Algorithm
1. Structure Diagrams — visual, hierarchical, top-down breakdown of a system
2. Flowcharts — visual, shape-based, shows the flow of control step-by-step
3. Pseudocode — text-based, structured English-like statements
Quick Analogy
If a structure diagram is like an org chart showing who reports to whom, a flowchart is like a map with directions and decision points ("turn left if raining"), and pseudocode is like writing out the driving directions as a numbered list in plain words.
2. Structure Diagrams

Structure diagrams top-down design decomposition

those

How the boxes connect
3. Flowcharts

flowchart flow of control what how

The Four Shapes You Must Know
4. Pseudocode

Pseudocode logic

The #1 Pseudocode Rule
print() input() INPUT OUTPUT IF...THEN...ELSE...ENDIF REPEAT...UNTIL
🔓 Read the full Algorithms note → You're seeing the preview · sign in to read it all
What's inside
📖 Revision notes 🎯 Learn mode ✦ AI flashcards ✓ Instant AI marking 🧊 3D explorers 🧪 Experiments & simulations 📈 Progress tracking
📄 Practise Algorithms with Computer Science 0478 past papers Every paper with its mark scheme — answer online, marked instantly. Open →

Read the full Algorithms notes free

That's the preview — create a free account to read the rest, plus flashcards and practice questions with instant AI marking. No credit card.

Unlock the full notes free →

More Computer Science topics