Binary search trees
Children walk through a large tree drawn on the ground, turning over nodes, and learn how a binary search tree stores things so they are quick to find.
Steps
- Remind the class how binary search works on a sorted list.
- Show the tree: lines to follow and nodes with hidden numbers underneath.
- Pick a target. The child starts at the top node and turns it over.
- If the target is smaller, go left. If it is bigger, go right. Repeat until you find it.
- Let children arrange new numbers into their own tree shapes.
- Compare how many nodes you visit with searching a list.
Talk about it
- Does the shape of the tree change the search?
- How is this different from binary search on a list?
- Where could a computer use a tree?
CC BY-SA 4.0
Adapted from CS Unplugged by the University of Canterbury Computer Science Education Research Group (CS Unplugged), licensed CC BY-SA 4.0.
Original lesson, with pictures · License: CC BY-SA 4.0
There are no pictures here. The original lesson has the pictures and printables.
Changes made: Simplified, shortened and translated by Open Cosmos with AI
This adapted lesson is shared under the same license (CC BY-SA 4.0).