0
Challenge · 40Trees
What a tree is
Treesused in ~100% of apps
Everything you have built so far has been a line. A tree is the first shape that branches, and once you can see it, five of the remaining tiers stop looking difficult.
Core idea. A tree is nodes joined by lines, with one node on top and no loops anywhere. Every node holds a value and points at its children. The important part is that each child is itself the top of a smaller tree, which is why almost every tree question is answered by asking the same question about a smaller tree.
poke it, drag it,
try to break it
try to break it
no slides here.
you drive.
you drive.
Playground, this isn't a screenshot
click any circle to find out what it is
Every circle is a node. The lines show which node hangs below which. Click one.
A tree is nodes joined by lines, with one node on top and no loops anywhere.
↑ play a little first, then dig in