Hermes Wiki

Trees And Heaps

Binary trees, BSTs, balanced trees (AVL/Red-Black at a conceptual level), tries, heaps/priority queues.

Why we need this / what value this brings

Tree traversal patterns (DFS/BFS variants) recur across a huge fraction of interview problems, and heaps are the go-to for any 'top-K' or scheduling problem.

When to use this

Hierarchical data, ordered data needing O(log n) insert/search, prefix-matching (tries), or 'give me the K largest/smallest' (heaps).

How to use or implement this

Master the traversal template (recursive and iterative) once, then recognize it across preorder/inorder/postorder/level-order variants rather than memorizing each separately.

Research questions

  • A priority queue for booking dispatch was already flagged as a genuine Localz use case in the parent README — worth a CaseStudy tying heap theory to that.

Empty folder — drop notes, links, and findings here as you research.

Hermes Wiki