Foundations · CS 101

Trees,
three ways

A tree is a hierarchy — one root, branches that never rejoin, leaves at the ends. Three places where trees quietly organize the world around us.

01

Directory tree

A filesystem is a tree. Click any folder to open or close it; the tree relays itself around your choice.

project/
02

DOM tree

When a browser reads HTML, it builds a tree. Hover anything on the left — watch the corresponding node light up on the right.

Hover any tag or text in the source to explore its tree node.
element node
text node
03

Expression tree

Arithmetic as a tree. Operators at the branches, numbers at the leaves. Evaluating means walking up from the leaves — children first, parent after.

( 3 + 4 ) × ( 5 − 2 )
Press "evaluate" to walk the tree bottom-up.