Guided Notes

Trees & Traversal

Tree terminology, binary trees, pre-order, in-order, and post-order traversal, and trees stored in arrays.

Trees

Slide 1 / 5

A tree is a hierarchical structure of nodes connected by edges:

• The root is the top node. • Each node can have children; a node with no children is a leaf. • A node's parent is the node above it. • The height is the number of edges on the longest path from the root to a leaf.

Trees model hierarchies everywhere: folders on a disk, the HTML DOM, organization charts, and family trees.