STUDY GUIDE · GKU 1
Algorithms, computability and complexity study guide (Computer Science)
This unit asks two kinds of question. The first is practical: given a problem, which method solves it, how fast, and with how much memory — answered by counting operations, solving recurrences, timing real runs, and choosing among divide and conquer, greedy rules, dynamic programming, backtracking and heuristics. The second is theoretical: what can a machine compute at all, and what can it compute efficiently — answered by finite automata and grammars, Turing machines and the halting problem, and the classes P and NP. The two halves meet in the last section, where knowing that a problem is NP-complete changes which algorithm you should write. Each section opens with a quick-revision card; worked examples run from easy to exam level, and every trace and number in them was checked by running it.
Structured by the official ETEC subject standard for this topic: every listed topic and learning outcome, with formulas, figures and worked examples. The full sections are available to members in the app.
SKU 1.1 · Basic analysis and algorithmic methods
Case behaviour, asymptotic notation and growth classes
Best, worst and average case of one algorithm; the formal definitions of , and ; counting the operations of a loop nest; and what the standard growth classes mean for the largest input a machine can handle.
Recurrences, amortised cost and empirical timing
The full three-case master theorem with the recursion-tree argument behind it, amortised analysis of a sequence of operations, and how to test a complexity claim by timing a program at doubling input sizes.
Divide and conquer, and the greedy choice
Splitting a problem into independent parts and combining the answers, with fast exponentiation and inversion counting implemented; and committing to the locally best choice, with the exchange argument that proves when that is safe.
Dynamic programming, backtracking and heuristics
Filling a table of overlapping subproblems (0/1 knapsack), searching a state space with pruning (n-queens), accepting a good-enough answer when exact search is too slow (nearest-neighbour tour), and deciding which method a problem calls for.
SKU 1.2 · Data structures, automata and computability
Searching, sorting and numerical algorithms
Implementing partition-based sorting and Euclid's algorithm, the time and memory each principal algorithm needs, the lower bound for comparison sorting, and how to pick a method for a stated situation.
Implementing hash tables and heaps, and choosing a structure
How a hash table is built — hash function, load factor, chaining or open addressing with linear probing or double hashing, deletion and resizing — how a binary heap lives in an array, and how to pick the structure a problem needs.
Graph algorithms: traversal, ordering, shortest paths and spanning trees
Breadth-first and depth-first search, topological sorting of a dependency graph, Dijkstra's shortest paths and Prim's minimum spanning tree, all traced on one small network, with their costs and the conditions they need.
String matching: naive, KMP and Rabin–Karp
Finding every occurrence of a pattern in a text: the brute-force method and its worst case, the Knuth–Morris–Pratt prefix function that never re-reads the text, and Rabin–Karp's rolling hash.
Finite automata, regular languages and grammars
Designing a deterministic finite automaton for a stated language, turning a nondeterministic one into a DFA, the limits of finite memory (the pumping lemma), and the step up to context-free grammars and the Chomsky hierarchy.
Turing machines, decidability and the halting problem
The computability part of the unit: what a Turing machine is, the Church–Turing thesis, decidable and undecidable problems, the diagonal proof that no program can decide halting, and why that limits every compiler and analyser.
Computational complexity: P, NP, reductions and NP-completeness
The classes P and NP defined through certificates, polynomial-time reductions and their direction, NP-complete and NP-hard problems, and what to do in practice when a problem turns out to be NP-hard.
MORE COMPUTER SCIENCE GUIDES
- Programming languages study guideGKU 7 · 11 sections
- Discrete structures study guideGKU 3 · 9 sections
- Software engineering study guideGKU 8 · 6 sections
- Computer architecture and organization study guideGKU 2 · 12 sections
- Operating systems study guideGKU 6 · 13 sections
- Information management: database systems and data modelling study guideGKU 4 · 10 sections
- Networking study guideGKU 5 · 10 sections