Skip to main content

Data Structures & Algorithms Study Guide

The whole course, unit by unit

Eight units from asymptotic analysis through the core structures to greedy, dynamic programming, and complexity classes. Open a unit for topic explanations, common mistakes, and practice.

Eight units

Foundations and analysis, array and string patterns, linear structures, hashing and heaps, trees, graphs, sorting, then algorithm design.

No single exam

Assessment is by implementation, timed problem solving, and explanation, mirroring how the material is used later.

Prerequisite

Comfortable programming in one language, including arrays, loops, and recursion.

Where it leads

University data structures courses, competitive programming, and technical interviews.

Units

The eight units

1

Unit 1 · Foundational

Foundations and Analysis

The vocabulary for comparing solutions. Without asymptotic reasoning every later unit collapses into opinion about which approach feels faster.

Big-OBig-ThetaRecurrenceCall stackOverlapping subproblemsDecomposition
2

Unit 2 · Highest leverage

Arrays, Strings, and Pattern Techniques

The four patterns that solve a disproportionate share of problems. Recognising which one applies is worth more than any amount of implementation speed.

Prefix sumTwo pointersSliding windowMonotonicAnswer spaceContiguous
3

Unit 3 · Moderate

Stacks, Queues, and Linked Structures

Structures defined by a restriction. The restriction is what makes each one fit a specific class of problem, so recognising the fit is the skill rather than the implementation.

LIFOFIFODequeNodeReferenceFast and slow pointers
4

Unit 4 · Heavy

Hash Tables, Heaps, and Priority Structures

Two structures that trade ordering for speed. Hashing gives constant average lookup by abandoning order entirely; a heap keeps only enough order to expose the extreme element.

Hash functionCollisionChainingProbingLoad factorHeap property
5

Unit 5 · Heavy

Trees and Balanced Search Structures

Ordering that supports fast search, but only while the shape stays balanced. The caveat is the unit, and self-balancing structures exist entirely to enforce it.

In-orderPost-orderBST propertyBalanceRotationTrie
6

Unit 6 · Heavy

Graphs and Network Algorithms

The most general structure, and the one where representation choice changes the complexity of everything built on it. Many problems that do not look like graphs become easy once modelled as one.

VertexEdgeAdjacency listBFSDFSDijkstra
7

Unit 7 · Moderate

Sorting Algorithms

A small set of algorithms used as a lens for comparing time, space, and stability. The comparison matters more than any single implementation.

Lower boundStableIn placePivotPartitionCounting sort
8

Unit 8 · Culminating

Advanced Algorithm Design

Choosing a strategy rather than a structure. The central discrimination is when a greedy choice is provably safe and when overlapping subproblems force a table instead.

Greedy-choice propertyOptimal substructureMemoizationTabulationStatePruning

Curriculum scope

What this sequence includes

Every unit answers the same two questions: what does this structure make cheap, and what does it make expensive. Choosing correctly is the skill; implementing is the exercise. The course therefore asks constantly for a justification rather than a working program alone.

Core topics

Essential foundations

  • • Asymptotic analysis, recurrences, and reasoning about growth
  • • Array and string patterns: prefix sums, two pointers, sliding window, binary search
  • • Stacks, queues, and linked structures, and the cost of pointer work
  • • Hash tables, heaps, and priority structures
  • • Trees, traversals, binary search trees, and balance
  • • Graph representation, traversal, shortest paths, and spanning trees
  • • Sorting algorithms compared by time, space, and stability
  • • Greedy strategies, dynamic programming, backtracking, and complexity classes

Additional topics

Included in this sequence

  • • Recognising which pattern a problem belongs to before coding
  • • Explaining a solution aloud, as an interview requires
  • • Trading time against space deliberately
  • • Knowing when a problem is likely intractable

Varies by course

Compare with the school syllabus

  • Language. Java, Python, and C++ are all used; the ideas transfer and the constant factors do not.
  • Advanced structures. Segment trees, tries, and union-find appear in some tracks and not others.
  • Contest emphasis. Some students take this alongside competitive programming and want heavier practice on patterns.

Glossary

Terms worth being precise about

Amortised cost

The average cost per operation across a sequence, used when one operation is occasionally expensive.

Monotonic

Consistently non-increasing or non-decreasing, which is the property two pointers and answer-space binary search rely on.

Load factor

Entries divided by buckets in a hash table, which predicts collision frequency.

Stability

A sort is stable when equal keys keep their original relative order.

In place

Using only constant extra space beyond the input.

Optimal substructure

An optimal solution is built from optimal solutions to subproblems.

Greedy choice property

The locally best choice leads to a globally optimal solution, which must be proved rather than assumed.

Memoization

Caching subproblem results on demand during a recursion.

Tabulation

Filling a table of subproblem results in dependency order.

NP-complete

In NP and at least as hard as everything in NP, with no known polynomial algorithm.

Need help with this topic?

Work through questions with a tutor and get help with the steps you find difficult.

Get help with this topic