Unit Overview
Data types & structures
CIE A-Level Computer ScienceΒ· 5 min read π n/a
1. Unit at a glance
This unit progresses from the most basic building blocks of data (primitive types) up to increasingly complex composite structures used to solve real-world computational problems. We first cover fundamental linear structures, then move to non-linear structures that model more complex relationships between data.
Mastery of this topic is critical for writing efficient code and answering problem-solving questions across the entire CIE 9618 syllabus. The choice of data structure directly impacts the efficiency of any algorithm you implement.
Below are all sub-topics covered in this unit, ordered from foundational to advanced:
Primitive data types
Foundational single-value atomic data types built into most programming languages.
β β± 5 min
Arrays
Linear collections of homogeneous data with static or dynamic sizing.
β β β± 7 min
Records
Composite data types that group heterogeneous related data fields.
β β β± 5 min
Linked lists
Dynamic linear structures made of nodes connected by pointers/references.
β β β β± 8 min
Stacks
Last-in-first-out (LIFO) linear structure with common practical applications.
β β β β± 6 min
Queues
First-in-first-out (FIFO) linear structure for ordered processing of data.
β β β β± 6 min
Trees
Hierarchical non-linear structure for modeling nested data relationships.
β β β β β± 10 min
Graphs
Non-linear structure for modeling networks and connections between nodes.
β β β β β± 10 min
Hash tables
Structure for efficient key-value lookup using hashing functions.
β β β β β± 9 min
2. Common Pitfalls
Wrong move:
Confusing stack and queue order of operations
Why:
Mixing up LIFO vs FIFO leads to incorrect solutions for common problems like expression evaluation.
Correct move:
Remember: Stack = Last In First Out (like a plate stack), Queue = First In First Out (like a checkout line).
Wrong move:
Selecting a data structure without evaluating tradeoffs
Why:
Arrays have fast access but slow insertion, while linked lists are the opposite, leading to inefficient solutions.
Correct move:
Always check what operations you will perform most before selecting a data structure.
Wrong move:
Treating all data structures as linear
Why:
Incorrect classification of trees and graphs leads to wrong traversal logic and property answers.
Correct move:
Always first classify a structure as linear or non-linear when analyzing its behavior.
3. Quick Reference Cheatsheet
Concept | Key Rule / Definition |
|---|---|
Primitive data types | Atomic single-value types: integer, float, boolean, character |
Static array access | Random access to any element takes time |
Linked list insertion | Insertion/deletion at a known node takes time |
Stack property | Follows Last-In-First-Out (LIFO) access order |
Queue property | Follows First-In-First-Out (FIFO) access order |
Binary tree rule | Each node can have at most 2 child nodes (left and right) |
Graph storage | Commonly stored as an adjacency matrix or adjacency list |
Hash table average lookup | Average case key lookup takes time |
Record definition | Composite type that stores multiple heterogeneous related fields |
What's Next
Start with the first sub-topic of this unit, which covers primitive data types β the foundational building blocks for all other data structures you will learn in this unit. Once you complete all sub-topics here, move on to the next unit on algorithms to see how these data structures are used to solve common computational problems.
