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

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. Instruction uses Java or Python. Algorithmic ideas carry across both languages, while implementation details and performance can vary.
  • 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