Trees

Binary tree traversals, BST properties, Trie (prefix tree).

1 min readInterview · DSA Patterns

Tree problems decompose into three patterns. Traversals answer "given this tree, compute X" via DFS (pre/in/post) or BFS. BST properties exploit left < root < right for O(h) operations. Trie is a specialized tree shape for prefix-keyed lookup.

Finished reading?

Mark it done to track your progress in Interview.

On this page

No Headings