Pro Content

Upgrade to access all Cambridge 9618 lessons including structure diagrams, flowcharts, and algorithm analysis.

Upgrade to Pro →
← Back to Dashboard
🧩 Paper 2 · 2.1 Algorithm Design
2.1.3 Abstraction, Decomposition and Structure Diagrams
Cambridge 9618 · International A Level Computer Science · ~12 min read
Notes
Video
Slides
Quiz
Worksheet

Abstraction

Abstraction means reducing a complex problem to its essential features by removing irrelevant details. In computing, abstraction occurs at many levels:

  • Problem abstraction — representing a real-world problem as a simplified model (e.g., a road network as a graph)
  • Data abstraction — hiding implementation details behind an interface (e.g., using a stack without knowing how it's stored internally)
  • Procedural abstraction — calling a function without knowing how it works internally
  • Abstraction layers — the layered model of computing (hardware → OS → application → user)

What abstraction removes

• Irrelevant details (traffic lights, road surfaces)
• Physical characteristics (colour of roads, distance units)
• Unnecessary complexity (exact GPS coordinates)

What abstraction keeps

• Connections between entities (which nodes are linked)
• Relevant properties (edge weights/distances)
• The structure needed to solve the problem

Real-World Examples of Abstraction

  • London Underground map — abstraction of the real rail network; shows connections, not true geography
  • Chess as a 2D array — abstracts away the physical board; only piece positions matter
  • A high-level programming language — abstracts away CPU instructions, registers, and memory addresses
  • A file system — abstracts away physical disk sectors; shows folders and filenames

Decomposition

Decomposition is breaking a large, complex problem into smaller, more manageable sub-problems. Each sub-problem is:
• easier to understand individually
• can be solved, coded and tested independently
• can be combined to solve the whole problem

Benefits of Decomposition

  • Easier to manage — large problems become a set of smaller, tractable tasks
  • Team development — different developers can work on different modules simultaneously
  • Reusability — modules can be reused in other programs
  • Easier testing — each module can be tested in isolation (unit testing)
  • Easier maintenance — a bug is isolated to a specific module

Structure Diagrams

A structure diagram (also called a hierarchy chart) is a visual representation of decomposition. It shows:

  • The top-level problem (root node)
  • How it is broken down into sub-problems (child nodes)
  • The hierarchy of modules

Structure diagrams do NOT show the order of execution or data flow — they only show the hierarchy/structure.

Example — Online Shopping System

Online Shopping System
|
User Account Product Catalogue Shopping Cart Payment
| | | |
Register Login Browse Search Add Item Checkout Card Receipt

Flowcharts

Flowcharts visually represent the logic/flow of an algorithm using standardised shapes. Cambridge 9618 requires knowledge of these symbols:

ShapeSymbolPurpose
Rounded rectangle (oval)START / ENDMarks the beginning or end of an algorithm
RectanglePROCESSA computation or assignment step (e.g., total ← total + 1)
DiamondDECISIONA yes/no question — branches the flow
ParallelogramINPUT / OUTPUTData input or output operations
ArrowsFLOWShow the direction of execution

Flowchart Example — Is a number positive?

START
INPUT num
num > 0?
YES
OUTPUT "Positive"
NO
OUTPUT "Not positive"
END

Comparison: Structure Diagrams vs Flowcharts

FeatureStructure DiagramFlowchart
Shows order of executionNoYes
Shows hierarchy of modulesYesNo
Shows decision logicNoYes (diamond)
Shows data flowNoNo (use DFD for this)
Best forPlanning module structureDocumenting algorithm logic
Exam tip: Cambridge 9618 Paper 2 examiners award marks for structure diagram accuracy. Common pitfalls: (1) confusing structure diagrams with flowcharts — structure diagrams show hierarchy, not flow; (2) failing to show enough levels of decomposition — go down to the level of individual procedures/functions.
⚠️ Common Mistakes
  • Saying abstraction and decomposition mean the same thing — they don't. Abstraction removes detail; decomposition breaks into sub-problems.
  • Drawing arrows between structure diagram nodes to show order — structure diagrams don't show sequence, only hierarchy
  • Using the wrong flowchart shape — processes (rectangle) and I/O (parallelogram) are commonly confused
  • Not drawing enough levels of decomposition in a structure diagram — go down until you reach individual procedures
✅ Notes completed!
Video coming soon
Click slide or press arrow keys to navigate

Worksheet — 2.1.3 Abstraction, Decomposition and Structure Diagrams

8 questions · Cambridge 9618 standard

Q1Explain what is meant by abstraction in the context of problem-solving, giving one real-world example.[3]
✅ Mark scheme
Abstraction is the process of removing or hiding unnecessary detail from a problem to focus on what is relevant [1]; this allows a complex real-world problem to be represented as a simplified model [1]; example: representing a road network as a graph (nodes = junctions, edges = roads) ignoring traffic signals, road surface type, and scenery [1]. Other valid examples accepted (e.g., London Underground map, chess as a 2D array).
Q2State three benefits of decomposition when developing a large software system.[3]
✅ Mark scheme
Any three: different developers can work on different modules simultaneously [1]; each module can be tested independently (unit testing) [1]; bugs are isolated to specific modules, making debugging easier [1]; modules can be reused in other programs [1]; each sub-problem is smaller and easier to understand [1].
Q3Describe what a structure diagram shows. State one thing it does NOT show.[3]
✅ Mark scheme
A structure diagram shows how a problem is broken down into a hierarchy of sub-problems/modules [1]; the top-level problem is the root node, with child nodes representing sub-problems at each level [1]; it does NOT show the order of execution (sequence) of the modules / does not show data flow / does not show decision logic [1].
Q4Name the four standard flowchart shapes used in Cambridge 9618 and state the purpose of each.[4]
✅ Mark scheme
Oval/rounded rectangle: start or end of algorithm [1]; Rectangle: process/computation step [1]; Diamond: decision point (yes/no branch) [1]; Parallelogram: input or output operation [1]. (Arrows/flow lines: show direction of execution — accept as optional fifth.)
Q5Explain the difference between a structure diagram and a flowchart.[3]
✅ Mark scheme
A structure diagram shows the hierarchical breakdown of a problem into modules — it shows structure, not sequence [1]; a flowchart shows the logic and flow of execution of an algorithm, including decisions and loops [1]; a structure diagram does not show order of execution or decision logic, while a flowchart does [1].
Q6A school wants to develop a library management system. List four top-level sub-systems you would identify in a structure diagram for this system.[2]
✅ Mark scheme
Any four of: book catalogue management [1]; member/student account management [1]; borrowing and returns processing [1]; overdue fines/notifications [1]; book search/reservations [1]; reports generation [1]. Award 1 mark per reasonable sub-system, max 2 marks.
Q7Write pseudocode for a procedure that takes an array of 10 integers (1-indexed) and outputs the sum and average. Declare all necessary variables with correct data types. Use a FOR loop and ensure the average is output as a REAL value even if the sum is INTEGER.[6]
✅ Mark scheme
PROCEDURE header with array parameter e.g. PROCEDURE CalcStats(Nums : ARRAY[1:10] OF INTEGER) [1]; DECLARE Sum : INTEGER ← 0 [1]; DECLARE Avg : REAL [1]; FOR loop from 1 to 10 accumulating Sum [1]; Avg ← Sum / 10 [1]; OUTPUT Sum and Avg [1]. Accept equivalent correct pseudocode. Award max 6.
Q8A program stores student data with fields: Name (STRING), Score (INTEGER), Grade (CHAR). The program must: input 5 students, assign a grade (A if Score ≥ 70, B if ≥ 50, else C), then output all names and grades. Write the pseudocode, using a record type and an array of records.[7]
✅ Mark scheme
TYPE Student RECORD / Name : STRING / Score : INTEGER / Grade : CHAR / ENDRECORD [1]; DECLARE Students : ARRAY[1:5] OF Student [1]; FOR loop 1 to 5: INPUT Name and Score into Students[i].Name and Students[i].Score [1]; IF/ELSEIF correctly assigning Grade: ≥70→'A', ≥50→'B', else 'C' [1]; Storing grade: Students[i].Grade ← grade [1]; Second FOR loop outputting Students[i].Name and Students[i].Grade for all 5 [1]; Correct pseudocode syntax throughout (ENDFOR, ENDIF, arrow assignment ←) [1]. Award max 7.
Topic Quiz
Question 1 of 10
You scored
out of 10
Card 1 of 6
Click to reveal definition
🎉
All cards reviewed!
TermDefinition
🎯

Mini Test — 2.1.3

10 questions · 10 marks · 10 minutes

← 2.1.2 Pseudocode
36 of 82 · Cambridge 9618
2.2.1 Data Types →