Oasis Search Party
A sandstorm hid the trail! Teach the camel team to search nearby places first, so nobody wanders past the closest water.
π§ Before we start
At Priority Clinic, you used a queue to remember who goes next. Today that queue becomes a search team: visit every nearby place before moving farther away. Programmers call this breadth-first search.
Build the search rule
Tap the four instruction blocks in the order the camel team should follow.
Search layer by layer
Tap the glowing place. Finish all places in one distance layer before exploring the next.
Choose the shortest discovery
Breadth-first search finds the oasis using the fewest path steps. Which route did the layers discover first?
Debug the skipped stop
This search history jumped out of queue order. Tap the buggy step, then repair it.
π What you learned
- A graph is a map of places joined by paths.
- A queue remembers which place the search visits next.
- Breadth-first search explores one distance layer at a time.
- On paths with equal steps, it can find a shortest route.
- Debugging restores a place that was skipped.