A-Level Lessons Aid: This resource is designed to support your revision and may contain errors. If you find a discrepancy with your class teaching, your teacher is correct -- please let us know at
alevelrevise@scott.scottrix.co.uk .
Home โบ
Computer Science โบ
Data Structures and Algorithms
Exam Board: AQA Pearson Edexcel OCR WJEC / Eduqas CCEA
๐ Key Points
Key Fact: Arrays: contiguous, O(1) access; Lists: dynamic, O(1) append amortised; Stacks: LIFO, push/pop; Queues: FIFO, enqueue/dequeue
Key Fact: Linked lists: singly/doubly, O(1) insert/delete at known position, O(n) access
Key Fact: Trees: binary, BST (left<root<right), AVL/Red-Black (balanced); traversals: pre/in/post-order, level-order
Key Fact: Graphs: adjacency matrix/list; directed/undirected, weighted/unweighted; BFS/DFS
Key Fact: Hash tables: O(1) average, collisions (chaining, open addressing), load factor
Key Fact: Big-O: O(1) < O(log n) < O(n) < O(n log n) < O(n^2) < O(2โฟ); best/average/worst case
Key Fact: Search: linear O(n), binary O(log n) sorted, hash O(1); Sort: bubble/insertion O(n^2), merge/quick/heap O(n log n)
Key Fact: Recursion: base case, recursive case; Tree traversals; Graph: Dijkstra (shortest path), Prim/Kruskal (MST), Topological sort (DAG)
๐ฏ Learning Objectives
Implement and use arrays, lists, stacks, queues, linked lists, trees, graphs, hash tables Analyse time and space complexity using Big-O notation Implement and trace search algorithms: linear, binary, hash-based Implement and trace sorting algorithms: bubble, insertion, merge, quick, heap Understand recursion and divide-and-conquer; apply to tree/graph traversals Apply algorithms to problems: shortest path (Dijkstra), MST (Prim/Kruskal), topological sort
๐ก Worked Example
Exam-Style Question
Question: Trace quicksort on [3, 6, 8, 10, 1, 2, 1] with pivot as first element
Model Answer:
Pivot=3. Partition: [1,2,1] + [3] + [6,8,10]. Recurse left: pivot=1 -> [1] + [1] + [2]. Right: pivot=6 -> [] + [6] + [8,10] -> pivot=8 -> [] + [8] + [10]. Result: [1,1,2,3,6,8,10]
โ Practice Questions Model answers are being added progressively - questions marked ✗ don't have one yet. Cross-check with your teacher or the official mark scheme.
Questions:
Implement stack using list✗ answer coming soon Write binary search recursive✗ answer coming soon Trace merge sort on [38,27,43,3,9,82,10]✗ answer coming soon Implement BFS for shortest path in unweighted graph✗ answer coming soon Design hash function for string keys✗ answer coming soon
๐ Past Papers & Exam Resources
๐ Further Reading & Resources
๐ Lesson Plan (50 minutes)
Starter (5 min): Recall prior knowledge of data structures and algorithms with quick questions.
Teaching (15 min): Work through each of the learning objectives, explaining principles step by step.
Key points review (5 min): Revisit the key points together, confirming understanding.
Worked example (10 min): Model the example question: Trace quicksort on [3, 6, 8, 10, 1, 2, 1] with pivot as first element. Solution: Pivot=3. Partition: [1,2,1] + [3] + [6,8,10]. Recurse left: pivot=1 -> [1] + [1] + [2]. Right: pivot=6 -> [] + [6] + [8,10] -> pivot=8 -> [] + [8] + [10]. Result: [1,1,2,3,6,8,10]
Practice (10 min): Students attempt the practice questions independently; circulate and support.
Plenary (5 min): Review answers and address misconceptions.
๐ Homework
Implement stack using list Write binary search recursive Trace merge sort on [38,27,43,3,9,82,10] Implement BFS for shortest path in unweighted graph Design hash function for string keys
๐งพ Assessment
Check practice answers against the model answer; use the built-in practice questions as formative assessment.
โ Programming Fundamentals
โ Back to Computer Science Overview
Computer Systems and Architecture โ
๐ Smart Lesson (Guided)
← Revision notes for this topic (A-Level Revise)