Skip to content

Glossary: Coding Interviews in Java

Greedy, topological sort, union-find, trie, bit tricks

Also written: Greedy, greedy algorithm, Topological sort, Union-find, Trie, tries, bit tricks, Dijkstra

Less common algorithm patterns. Greedy takes the best-looking choice at each step (it fails for 13 lb with bags of 2, 5 and 6), topological sort orders tasks that depend on each other, union-find tracks groups that merge, a trie is a tree of letters for prefix search, and bit tricks use binary operations.

Where the book teaches it

Related terms

Dynamic programming (DP)Monotonic stack