Glossary

Tree (data structure)

A tree is a hierarchical data structure of nodes and edges. One root node; each node can have children. No cycles. The HTML DOM, filesystem, and syntax tree of a program are all trees.

Key terms

Types of trees

Traversals

Pre-order (root → left → right), In-order (left → root → right; yields a sorted BST), Post-order, BFS (level by level).