Examinable Syllabus for Algorithms I
Algorithms I Syllabus (25/26, Lent Term)
The following topics are examinable for the Algorithms I component of CST Paper 1 (one question from a choice of two). The course covers 12 lectures taught by Dr John Fawcett.
Sorting Algorithms
All of the following sorting methods are examinable, including pseudocode, correctness proofs (via loop invariants), and asymptotic analysis:
- Insertion sort: incremental, worst case, best case (sorted input). Stable, in-place. Tight loop makes it fast for small .
- Merge sort: divide and conquer, worst and average case. Stable. Not in-place (requires auxiliary space). Solved via Master Theorem or substitution.
- Quicksort: divide and conquer with partition about a pivot. worst case (sorted input, or constant split-off), expected case. In-place (Lomuto or Hoare partition). Instability of partition step makes it unstable.
- Quicksort with Median-of-Medians: guarantees worst case by selecting the median as pivot in time.
- Heapsort: build a max-heap in , then extract times at each. total. In-place, unstable. Demonstrates the heap data structure.
- Counting sort: , where keys are in . Non-comparison; stable. Requires to be linear.
- Radix sort: sort digit-by-digit using a stable sort (e.g. counting sort) on each digit. for -digit numbers.
- Bucket sort: assumes uniform distribution over . average, worst.
Sorting lower bounds: any comparison-based sort requires comparisons. This is an information-theoretic lower bound (decision tree argument).
Asymptotic Notation
All five notations must be understood, with formal definitions and the ability to prove membership:
| Notation | Meaning | Formal definition |
|---|---|---|
| Asymptotic upper bound | for | |
| Asymptotic lower bound | for | |
| Asymptotically tight bound | ||
| Non-tight upper bound | For any , | |
| Non-tight lower bound | For any , |
Properties: transitivity (all five), reflexivity (), symmetry ( only).
Algorithm Design Strategies
- Incremental: build solution step by step (insertion sort).
- Divide and conquer: split into non-overlapping subproblems, solve recursively, combine (merge sort, quicksort, quicksort MoM, quickselect, Strassen’s algorithm).
- Dynamic programming: overlapping subproblems with optimal substructure; memoisation; top-down (recursion + cache) and bottom-up (table filling).
- Greedy algorithms: locally optimal choice leads to globally optimal solution; requires proof of correctness (exchange argument).
- Semi-structures: heaps are cheaper to build than fully-sorted structures.
Methods for Solving Recurrences
- Guess and verify (substitution method): guess a bound, prove by induction.
- Substitute and spot pattern: expand recurrence, identify arithmetic/geometric series, solve closed form.
- Recursion tree method: draw call tree, sum costs per level, multiply by number of levels.
- Master Theorem: for recurrences of form . Three cases based on comparing with .
Data Structures (Algorithms I Only)
Elementary Structures
- Pointers, NIL, objects.
- Stacks (LIFO): PUSH, POP, O(1). Array and linked-list implementations.
- Queues (FIFO): ENQUEUE, DEQUEUE, O(1). Circular buffer array implementation.
- Singly and doubly linked lists; cyclic variants; sentinel nodes.
- Rooted trees: with/without parent pointers, fixed/variable child counts.
Binary Search Trees
- BST property; SEARCH, INSERT, DELETE, MINIMUM, MAXIMUM, PREDECESSOR, SUCCESSOR.
- All ; worst case, expected for random insertion.
- Inorder traversal produces sorted order.
Balanced Search Trees
- B-trees: minimum degree ; to keys per node; to children. Height . Search, insert (top-down splitting), delete (redistribute/merge). All . Disk I/O motivation.
- 2-3-4 trees: B-tree with . 1—3 keys, 2—4 children per node. Conceptual bridge to red-black trees.
- Red-black trees: five colour properties, black-height, height . Insertion fix-up (3 cases: recolour, zig-zag rotation, zig-zig rotation). Isomorphism with 2-3-4 trees. All operations .
Hash Tables
- Dictionary ADT: INSERT, DELETE, SEARCH.
- Hash functions: division method, multiplication method, range reduction.
- Collision resolution by chaining (4 variants).
- Collision resolution by open addressing (linear, quadratic, double hashing).
- Primary and secondary clustering.
- Load factor , resizing, amortised insert.
- Universal hashing: definition, example family, adversarial protection.
Priority Queues and Heaps
- Binary heaps: min-heap and max-heap. Structural property (complete tree) and ordering property (parent children for min-heap).
- Array representation: root at index 1, children at and , parent at .
- MAX-HEAPIFY (REHEAPIFY): .
- BUILD-MAX-HEAP: .
- HEAPSORT: .
- Priority queue operations: INSERT, EXTRACT-MIN/MAX, DECREASE-KEY, all via heap; also implementable via red-black trees.
Order Statistics
- MINIMUM and MAXIMUM in via linear scan; simultaneous min+max in comparisons.
- Quickselect: expected , worst case . With Median-of-Medians: worst case .
Tripos Question Format
Algorithms I is assessed in CST Paper 1, questions 7 and 8 (one to be answered from two). Typical structure:
- Part (a): theory, definition, proof (e.g. state a loop invariant, prove correctness, derive a height bound).
- Parts (b—d): application, algorithm design, tracing, or modifying an algorithm for a variant problem.
Past papers from 2006—2026 are available. The syllabus is broadly stable across years.
Summary of Examinable Topics
| Category | Topics |
|---|---|
| Sorting | Insertion, Merge, Quick, Heap, Counting, Radix, Bucket; stability; lower bounds |
| Asymptotics | , , , , ; definitions and properties |
| Recurrences | Substitution, tree method, Master Theorem |
| Design strategies | Incremental, divide and conquer, DP, greedy, semi-structures |
| Proofs | Loop invariants (initialisation, maintenance, termination); induction |
| Elementary DS | Stacks, queues, linked lists, trees |
| BSTs | Search, insert, delete; degeneracy |
| Balanced trees | B-trees, 2-3-4 trees, red-black trees; isomorphism |
| Hash tables | Chaining, open addressing, universal hashing, resizing |
| Heaps | Heapify, heapsort, priority queues |
| Order statistics | Quickselect, Median-of-Medians |