🧮Tree (Data Structure)
Also known as Tree, Tree Structure
Nodes joined in a branching shape, with one root at the top and no loops.
Think of it like
Think of it like a family tree. One person is at the top, and the kids are below.
Example
Jack's computer keeps his files in a tree. The home folder is the root, and each photo is a leaf three folders down.
Why it matters
Computers store anything with parents and children as a tree. Files, web pages and menus are all trees.
Definition
Common mistake
Key takeaways
- 1One root. At the top.
- 2Parents and children. Branching down.
- 3No loops. One path to each node.