Unit bundle · Written for OCR A Level (H446)

Data Structures – OCR A Level Computer Science lessons (H446)

Fifteen Year 12 lessons on stacks, queues, linked lists, trees, binary search trees, graphs, traversals and hash tables.

Also in a bundle Year 12 A Level Computer Science – a full year of OCR H446 lessons 165 lessons for £199 · save 69% on buying separately

Students build and trace every data structure the specification names: records, tuples, stacks, queues, linked lists, trees, binary search trees, graphs and hash tables. Each one is coded both with arrays and pointers and as a class, and traced by hand, because the most repeated examiner finding is a pop() that returns before it moves the pointer.

Unit 12.8 is taught in Year 12, Spring 2, and answers one big question: How does the shape of the data decide a program's speed?

What happens in each lesson:

Lesson 1, Records, tuples, lists and 3D arrays: How should one parcel's details be grouped together? Main task: write a record structure for a Tillbrook Parcels parcel with four fields of different data types, then declare a 3D array of parcel counts for 4 depots, 6 vans and 7 days and state how many elements it holds (6 marks).

Lesson 2, Static and dynamic data structures: Should a structure's size be fixed before the program runs? Main task: compare static and dynamic data structures, and justify which Tillbrook should use for the parcels loaded onto one van, which holds at most 120 (6 marks).

Lesson 3, Stacks: push, pop and peek: Why must the last parcel loaded be the first out? Main task: write the push and pop functions for a stack of 10 parcels in a Tillbrook van, held in an array with a top pointer that starts at -1; pop must return the parcel removed (6 marks).

Lesson 4, Queues: linear and circular: How can a queue reuse space without moving any items? Main task: trace eight enqueue and dequeue operations on Tillbrook's circular queue of 6 scanning jobs, showing the array, front, rear and count after each one (6 marks).

Lesson 5, Coding stacks and queues: How do we know our stack and queue code is safe? Main task: write a Python class for Tillbrook's returns desk: a circular queue of 5 returns whose enqueue and dequeue report overflow and underflow, then test it when empty, full and holding one item (8 marks).

Lesson 6, Linked lists: How can items stay in order without sitting side by side? Main task: describe how a Tillbrook driver's route of drop-off stops is stored in the given linked list table, then write an algorithm that outputs every stop in route order (6 marks).

Lesson 7, Adding to and removing from a linked list: What must change when a stop is added or removed? Main task: complete the table, start pointer and free pointer after Tillbrook adds an urgent stop in postcode order and then removes a cancelled stop from a driver's route (6 marks).

Lesson 8, Trees and binary search trees: Why does a sorted tree find items faster than a list? Main task: draw the binary search tree formed when Tillbrook's depot codes are added in the given order, and explain why searching it is faster than searching an unsorted list of the same codes (5 marks).

Lesson 9, Adding to and searching a binary search tree: How does a binary search tree halve the work at each step? Main task: write a function that searches Tillbrook's binary search tree of tracking numbers, stored as left, data and right arrays with −1 as null, and returns True if a number is present (6 marks).

Lesson 10, Depth-first and breadth-first traversal of trees: In what order should every node in a tree be visited? Main task: write the post-order and breadth-first traversals of Tillbrook's tree of hubs and depots, and explain how a queue is used in the breadth-first traversal (6 marks).

Lesson 11, Graphs: directed, undirected and weighted: How can a computer store a map of delivery routes? Main task: draw the adjacency matrix for the weighted, directed graph of roads between Tillbrook's five depots, and explain why the matrix is not symmetric (5 marks).

Lesson 12, Traversing graphs: How do we visit every place on a map exactly once? Main task: write a breadth-first traversal in Python that uses a dictionary adjacency list of Tillbrook's depots, a queue and a visited list, and outputs every depot reachable from the main hub (6 marks).

Lesson 13, Hash tables and collisions: How can an item be found without searching for it? Main task: calculate the index of each of eight Tillbrook tracking numbers with the given hash function, store them using linear probing, and describe how a lookup finds a number that collided (6 marks).

Lesson 14, Exam skills: tracing and writing data structure algorithms: How do you score full marks on a data structure question? Main task: complete the trace table for the given push and pop calls on a Tillbrook van stack, then identify the two errors in the given linked list insertion algorithm, giving each line number and its corrected line (8 marks).

Lesson 15, Progress Check: 38 multiple-choice questions (homework or the start of the lesson) + a 40-mark written paper in the lesson (45 minutes)

Misconceptions it tackles include
“A record is a row in a database table”; “A dynamic structure can never run out of memory”; “pop() can return the item first and decrement the top pointer afterwards”. Each is planned into a hinge question before the main task or an exit question, so you find out who still holds it.
OCR H446 specification coverage
1.4.2, data structures: (a) arrays of up to three dimensions, records, lists and tuples; (b) linked lists, directed and undirected graphs, stacks, queues, trees, binary search trees and hash tables; (c) creating, traversing, adding data to and removing data from each, with arrays and procedures or with objects; 2.3.1 (e), algorithms for the main data structures: stacks, queues, trees and linked lists, with depth-first (post-order) and breadth-first traversal of trees.

It builds on 12.2 Programming Foundations (arrays, subroutines, parameters), 12.4 Searching, Sorting and Recursion (binary search and recursion, used again for trees), 12.6 Object-Oriented Programming (classes for each structure) and 12.7 Assembly Language and Software Development. It leads on to 12.11 Compression, Encryption, Hashing and Databases (hashing), 12.12 Programming Project (A Level data structures in students' own projects), 13.2 Big O (the cost of each operation) and 13.4 Path-finding (Dijkstra's and A* on weighted graphs).

Adapting it for your school
Tillbrook Parcels is a fictional parcel-delivery firm. Swap it for any organisation with queues and routes, such as a bus company; every Build keeps its structure. Lessons 5 and 12 need Python on computers; each has a paper version in OCR pseudocode with a trace table. If 12.6 Object-Oriented Programming has not been taught yet, write the class versions in lessons 5 and 12 with arrays and procedures; 1.4.2 (c) accepts either. Keep the lesson 11 road graph on display: lesson 12 stores it as an adjacency list and traverses it. (13.4 uses its own warehouse graph for Dijkstra's and A*.)

An independent resource written for OCR A Level Computer Science (H446). It is not endorsed by OCR or Cambridge University Press & Assessment. Programming project (NEA) lessons teach general skills on a made-up example project and give supervised time, within JCQ's rules on the help a centre may give.

What's included

  • 15 lesson slide decks (PowerPoint)
  • 15 lesson plans (Word)
  • 15 worksheets, plus 14 support versions with scaffolds (Word)
  • 1 exam-style paper with mark scheme (Word)
  • Medium term plan with intent, key words, misconceptions and adaptive teaching notes (Word)
  • Progress Check lesson to assess the unit
  • Exam skills - tracing and writing data structure algorithms - Quiz Quiz Trade Cards
  • Department licence: every teacher in your department can use and adapt it

In this bundle

Worth £60 bought separately at £4 a lesson. The bundle saves you 25%.

More for A Level Computer Science

See all

Written for the specifications named. Not endorsed by or affiliated with any exam board.