Core skills
Pettah Market
A market town full of parcels, letters and railways. Search a street, sort a belt, build a hash table, plan a route and shunt wagons. Binary search, sorting, hashing, graphs and stacks.
11 levelsAbout 50 min
What you will practise
- Binary search
- O(log n)
- Sorted data
- Database index
- B-tree
- Bubble sort
- Insertion sort
- O(n squared)
- O(n log n)
- Hash table
- Level 1Find the HouseA short street, a hidden house, helpful neighbours.
- Binary search
- O(log n)
- Divide and conquer
- Level 2The Long StreetOne thousand houses and only fourteen knocks.
- O(log n)
- Sorted data
- Database indexes
- Level 3The Endless RoadA million houses. Twenty-four knocks.
- Database index
- B-tree
- Search at scale
- Level 4Parcel ScaleSort the parcels with only a balance scale.
- Bubble sort
- Insertion sort
- Merge sort
- O(n log n)
- Level 5The Big DeliveryNine parcels. A budget that punishes guessing.
- O(n squared)
- O(n log n)
- Divide and conquer
- Merge sort
- Level 6Pettah PigeonholesA post office sorts letters by town.
- Hash table
- Hash function
- Collision
- Dictionary / Map
- Level 7The Sorting OfficeEighty towns and a bigger post office.
- Load factor
- Resizing
- Open addressing
- Chaining
- Level 8Rail NetworkColombo to Jaffna by the quickest route.
- Graph
- Dijkstra's algorithm
- BFS
- Weighted edges
- Level 9Island RailGalle to Trincomalee across the whole island.
- Dijkstra's algorithm
- Routing
- A* search
- Graph traversal
- Level 10The SidingReorder wagons with a dead-end track.
- Stack
- LIFO
- Call stack
- Undo history
- Level 11Marshalling YardNine wagons and no room for mistakes.
- Depth-first search
- Expression parsing
- Backtracking

