The fleet is growing, and new crew keep asking the same thing: who do I report to?
Rocket tries a list of everyone. "Ada, Bo, Cy, Dee, Eve," he reads. "But that does not show who leads who."
Raven sketches Ada at the top, with lines down to her two leads. "What do you notice about Bo's part of the drawing?"
"It looks like a small copy of the whole thing," Rocket says. "Bo at the top, with crew below."
Nova projects the drawing. "Here is a hint. This shape has a name. It is a tree, drawn upside down."
Each person in the tree is a node. Ada is the root, at the top. Lines go down from each node to its children.
| Node | Leads (children) |
|---|---|
| Ada (captain) | Bo, Eve |
| Bo (pilot lead) | Cy, Dee |
| Eve (science lead) | Fen, Gil, Hal |
| Cy, Dee, Fen, Gil, Hal | nobody |
Trees can hold places, not just people. Here is the ship, drawn as a tree of decks and rooms.
| Node | Children |
|---|---|
| Ship | Deck A, Deck B |
| Deck A | Lab, Dock |
| Deck B | Bridge, Hold |
| Lab, Dock, Bridge, Hold | none |
| Statement | True or false? |
|---|---|
| Ship has two children. | ? |
| Bridge is the root. | ? |
| Deck A is the root of its own smaller tree. | ? |
| A leaf has an empty list of children. | ? |
Great work! Trees are everywhere in computing, from folders on a computer to the shape of a web page. Tomorrow we store the tree in Python.