Drawings
Every structure, drawn as what it really is.
A tree is not a row of boxes, so we never draw it as one. These are the twelve drawings used across all the problems. Things that are being looked at lift up off the page, like a key you are pressing.
What the colours mean
- looking now
- checking
- seen
- done
- answer
- rejected
- path
- just added
- ignored
Array
A row of numbered lockers
Little numbers on top are the positions, starting at 0. Black tags underneath are fingers like i and j. A blue bracket marks a window.
- looking now
- checking
- done
Linked list
A toy train
Each box holds a value and a hook. Arrows show where each hook points. Flipped arrows point left. A dashed red line means the last car hooks back into the train.
- looking now
- done
Stack and queue
A pile of plates and a lunch line
The stack is a cup: you add and remove at the top. The queue is a lane: you join at the back and leave from the front.
- looking now
Binary tree
A family tree
Lines are parent to child. A blue path is the route being followed. Small blue notes under nodes hold answers like heights or sums.
- looking now
- path
Heap
A tree living in an array
The heap is drawn twice: as the tree it acts like, and as the array it is stored in. Same colours in both, so you can see where each spot lives.
- looking now
- checking
Any tree
Tries, choices and recursion
Nodes can have many children. Letters on the lines are the choices made. A double ring marks where a word ends or an answer was found.
- answer
Graph
Towns and roads
Circles are towns, lines are roads, numbers on lines are lengths. Orange badges hold what we learned about a town, like its distance from the start.
- looking now
- done
- path
- done
Grid
A chocolate bar of squares
For matrices, boards, mazes and dynamic programming charts. Blue arrows show which squares an answer was built from.
- looking now
- checking
Map and set
A notebook and a bag of marbles
A map pairs each key with a value. A set just remembers what it has seen, each thing once.
- looking now
- just added
Bits
A row of light switches
Each number becomes switches. Bit 0 is on the right. Off switches are faded.
- answer
Timeline
Meetings on a calendar
Each bar is one meeting, job or train. The red dashed line is the time we are looking at.
- done
- rejected