Tree

Applies to: general

A tree is a hierarchical structure of nodes, each with children, and one root. It models nesting (file systems, parse trees, decision trees) and supports O(log n) search when balanced. Trees are naturally processed with recursion.

        root
       /    \
      a      b
     / \
    c   d

See also: graph, bfs, dfs, recursion