Select the operation contract supported by the stated structure and workload.
Lessons
- Binary search trees: preserve order through every branch
- Binary heaps: select the next priority with a tie rule
- Tries: make prefix search distinct from complete-key lookup
- Graphs: adjacency lists and breadth-first reachability
- Disjoint sets: merge connectivity without tracing every path
- Fenwick trees: update points and query prefix totals
- Segment trees: combine child ranges after updates
