Track 05 · Data Structures
The Data Structures track
Arrays, lists, trees, heaps and graphs — watch the pointers move and the search space shrink.
69 concepts mapped · 15 interactive now · 110 steps · free, no login
01Complexity
1 of 3 liveThe vocabulary for saying why one solution beats another.
- 01
Big-O notation
Counting how work grows with n, and ignoring everything else.
intro8 min6 steps0% - 02
Amortised analysis
upcomingWhy an occasionally expensive operation can still be O(1) on average.
- 03
Space complexity
upcomingExtra memory as a cost, including the stack recursion uses.
02Arrays & strings
3 of 5 liveContiguous memory, and the techniques it makes possible.
- 04
Arrays in memory
One block, constant-time indexing, and O(n) insertion in the middle.
intro8 min6 steps0% - 05
Dynamic arrays & growth
upcomingDoubling capacity, and why append is amortised O(1).
- 06
Two pointers
Two indices walking one array, turning O(n²) scans into O(n).
core10 min7 steps0% - 07
Sliding window
A range that grows and shrinks instead of being rebuilt.
core10 min8 steps0% - 08
Prefix sums
upcomingPrecompute once, answer any range query in constant time.
03Linked structures
1 of 4 liveNodes scattered in memory, held together by references.
- 09
Singly linked lists
Every node knows only the next one. Everything the structure can and cannot do follows from that.
core10 min8 steps0% - 10
Doubly linked lists
upcomingA back pointer, and the deletion it makes cheap.
- 11
Reversing a list
upcomingThree pointers, one pass, and the order of assignments that matters.
- 12
Cycle detection
upcomingFloyd's slow and fast pointers, and why they must meet.
04Stacks & queues
1 of 4 liveRestricting access on purpose.
- 13
Stacks
Last in, first out — and the call stack you already met.
intro8 min6 steps0% - 14
Queues & circular buffers
upcomingFirst in, first out, with a ring so nothing has to shift.
- 15
Deques
upcomingBoth ends open, and the operations that stay O(1).
- 16
Monotonic stacks
upcomingKeeping the stack sorted to answer next-greater in one pass.
05Hashing
1 of 3 liveTurning a key into an address.
- 17
Hash tables
A hash becomes a bucket index, and average O(1) lookup follows.
core9 min6 steps0% - 18
Collisions
upcomingChaining and open addressing — two answers to the same problem.
- 19
Sets & deduplication
upcomingMembership in constant time, and the frequency-count pattern.
06Trees
2 of 6 liveHierarchies with logarithmic depth, when you keep them balanced.
- 20
Binary trees
upcomingNodes, children, height — and why height decides the cost.
- 21
Tree traversals
In-order, pre-order, post-order and level-order, and what each is for.
core11 min8 steps0% - 22
Binary search trees
One ordering rule turns searching into a sequence of yes/no decisions.
core11 min9 steps0% - 23
BST deletion
upcomingThree cases, and the successor that replaces a two-child node.
- 24
Balancing & rotations
upcomingWhy a sorted insert order degrades a BST into a linked list.
- 25
Tries
upcomingOne node per character — prefix search without scanning every word.
07Heaps & priority queues
0 of 3 liveFast access to the smallest thing, and nothing else.
- 26
Binary heaps
upcomingA tree stored in an array, with the parent always winning.
- 27
Push, pop & heapify
upcomingSift up, sift down, and building a heap in O(n).
- 28
Priority queues in practice
upcomingScheduling, top-k, and merging sorted streams.
08Sorting
3 of 6 liveThe classic algorithms, and what separates them.
- 29
Bubble, selection & insertion sort
O(n²) sorts — and why insertion sort is still used inside fast ones.
intro10 min6 steps0% - 30
Merge sort
Divide, sort halves, merge — stable and reliably O(n log n).
core11 min8 steps0% - 31
Quicksort
Partition around a pivot, and the input that makes it O(n²).
deep12 min8 steps0% - 32
Heap sort
upcomingBuild a heap, then pop repeatedly — in place, no extra memory.
- 33
Counting & radix sort
upcomingBeating O(n log n) by not comparing elements at all.
- 34
Stability & choosing a sort
upcomingWhat stability means, and when it changes your answer.
09Searching
1 of 3 liveFinding things faster than looking at all of them.
- 35
Binary search
Every comparison throws away half the array. That is the whole algorithm.
core9 min8 steps0% - 36
Lower & upper bound
upcomingFinding the first or last match rather than any match.
- 37
Binary search on the answer
upcomingSearching a range of possible answers instead of an array.
10Graphs
2 of 6 liveNodes and edges — the most general structure here.
- 38
Representing a graph
upcomingAdjacency list against adjacency matrix, and when each one wins.
- 39
Breadth-first search
A queue, level by level — and the shortest path in an unweighted graph.
core11 min8 steps0% - 40
Depth-first search
A stack, or recursion, and going as deep as possible first.
core11 min8 steps0% - 41
Topological sort
upcomingOrdering tasks so every dependency comes first.
- 42
Dijkstra's algorithm
upcomingShortest paths with weights, using a priority queue.
- 43
Union-find
upcomingConnected components, with path compression making it near-constant.
11Recursion & dynamic programming
0 of 5 liveSolving a problem by solving smaller versions of it.
- 44
Recursion & the recursion tree
upcomingDrawing the calls to see the repeated work.
- 45
Memoization
upcomingCaching subproblems turns exponential into linear.
- 46
Tabulation
upcomingFilling a table bottom-up, with no recursion at all.
- 47
Classic DP problems
upcomingKnapsack, LCS and edit distance — the same table, different rules.
- 48
Backtracking
upcomingTrying a choice, undoing it, and pruning branches that cannot work.
12Balanced trees & range structures
0 of 5 liveTrees that stay short no matter the insertion order, and structures for range queries.
- 49
AVL trees
upcoming13 minRebalance after every insertion with rotations to keep depth O(log n).
- Track height at each node and detect imbalance
- Apply LL, LR, RL, RR rotations
- Compare AVL to red-black on rotation frequency
- 50
Red-black trees
upcoming14 minThe tree that std::map and TreeMap actually use — coloured to keep the depth bounded.
- State the five red-black invariants
- Fix up colours after insertion in the six cases
- Understand why deletion is much harder than insertion
- 51
B-trees & B+ trees
upcoming13 minWide-branching trees designed for disk: one node fills a disk block.
- Understand why databases and filesystems use B-trees, not BSTs
- Split and merge nodes to maintain the fill invariant
- Contrast B+ trees (leaves linked, keys duplicated) with plain B-trees
- 52
Segment trees
upcoming13 minAny associative range query in O(log n) — sum, min, max, gcd.
- Build a segment tree bottom-up in O(n)
- Point-update in O(log n)
- Add lazy propagation for range updates
- 53
Fenwick (BIT) trees
upcoming11 minPrefix sums with updates — the same job as a segment tree in a fraction of the code.
- Build a Fenwick tree from an array
- Query prefix sums in O(log n)
- Point-update the tree in O(log n) with the low-bit trick
13String algorithms
0 of 5 liveDoing more than a linear scan when the pattern gets clever.
- 54
KMP: Knuth-Morris-Pratt
upcoming12 minNever re-examine a character — precompute the failure function.
- Compute the failure (border) array in O(m)
- Skip forward correctly on mismatch
- Understand why the total scan stays O(n+m)
- 55
Rabin-Karp: rolling hashes
upcoming11 minHash the pattern; slide a hash across the text; compare only on hash match.
- Choose a hash and prime that keep collisions rare
- Update the hash in O(1) as the window slides
- Use rolling hash for multi-pattern search
- 56
Z-algorithm
upcoming11 minFor each position, the length of the longest prefix that matches — computed in O(n).
- Build the Z array with the two-pointer trick
- Solve pattern matching with a single Z pass on pattern$text
- Compare Z, KMP, and Rabin-Karp
- 57
Suffix arrays
upcoming13 minSort every suffix of a string; now any substring lives at one contiguous range.
- Build a suffix array with SA-IS or DC3 (concept only)
- Binary-search a pattern in O(m log n)
- Pair with the LCP array for repeat detection
- 58
Compressed & Aho-Corasick tries
upcoming13 minMatch many patterns in one scan of the text — the algorithm behind grep -F.
- Compress a plain trie into a radix tree
- Add failure links for Aho-Corasick
- Match k patterns against text in O(n + k) total
14Advanced graphs
0 of 6 liveBeyond BFS and DFS — weighted paths, flow, and reachability tricks.
- 59
Bellman-Ford & negative edges
upcoming11 minDijkstra assumes non-negative weights; Bellman-Ford does not — at O(VE) cost.
- Relax edges V-1 times
- Detect negative-weight cycles
- Compare BF, Dijkstra, and SPFA
- 60
Floyd-Warshall
upcoming10 minAll-pairs shortest paths in O(V³) — three nested loops of pure arithmetic.
- Write the three-loop DP
- Reconstruct paths from the parent matrix
- Recognise when V³ is fine (small V, dense graph)
- 61
Max-flow & Ford-Fulkerson
upcoming15 minPush as much flow through a network as capacities allow — and prove it's the maximum.
- Find augmenting paths in the residual graph
- Understand the max-flow min-cut theorem
- Compare Edmonds-Karp (BFS) with Dinic's algorithm
- 62
A* search
upcoming12 minDijkstra with a heuristic — the classic pathfinder for games and maps.
- Choose an admissible, consistent heuristic
- Understand why Manhattan distance works for a grid and Euclidean doesn't for a road network
- Compare A* against Dijkstra on the same map
- 63
Kruskal & Prim: MST
upcoming12 minCheapest set of edges that keeps the graph connected.
- Sort edges and add them if they don't create a cycle (Kruskal + union-find)
- Grow a tree from a start node, always taking the cheapest crossing edge (Prim)
- Recognise MST use cases: clustering, network design
- 64
Strongly connected components
upcoming12 minGroup nodes that can all reach each other — via Tarjan or Kosaraju.
- Run Kosaraju's two DFS passes
- Follow Tarjan's low-link discovery
- Compress a graph to its SCC DAG for further analysis
15Advanced algorithm design
0 of 5 liveThe techniques you reach for when the obvious algorithm is too slow.
- 65
Divide & conquer, and the master theorem
upcoming12 minThe recipe behind merge sort, quicksort, closest pair, and Strassen.
- Recognise the T(n) = aT(n/b) + f(n) shape
- Apply the three master-theorem cases
- Use the substitution method when the master theorem doesn't apply
- 66
Randomised algorithms
upcoming12 minA random choice can turn worst-case O(n²) into expected O(n log n).
- Understand why randomised quicksort dodges the sorted-input trap
- Use reservoir sampling for a random element from a stream
- Reason about Las Vegas vs Monte Carlo algorithms
- 67
Approximation for NP-hard problems
upcoming12 minGuaranteed within some ratio of optimal — because optimal is too expensive.
- Understand 2-approximation for vertex cover
- Greedy set cover and its ln(n) bound
- Recognise where LP relaxation buys you an approximation
- 68
Minimax & alpha-beta
upcoming12 minSearch a game tree to a fixed depth, and prune the branches that can't matter.
- Implement minimax on a simple game (tic-tac-toe)
- Add alpha-beta pruning without changing the result
- Understand how iterative deepening plus alpha-beta enables real AI
- 69
Computational geometry basics
upcoming13 minConvex hulls, line-sweep, closest pair — geometry that runs in O(n log n).
- Compute a convex hull with Graham scan or Andrew's monotone chain
- Detect segment intersections with a sweep line
- Find the closest pair of points in O(n log n)
The full syllabus is listed above in teaching order. Concepts marked upcoming are mapped but not yet built as visualizations. Progress is kept in this browser only.