Select the operation contract supported by the stated structure and workload.
Lessons
- Resizable arrays: account for growth and shifting
- Prefix sums: trade one scan for constant-time ranges
- Singly linked lists: preserve head and tail invariants
- Doubly linked lists: relink known nodes safely
- Stacks: last-in-first-out for reversible edits
- Queues: preserve arrival order without front shifts
- Ring buffers: make capacity and overwrite rules explicit
- Hash maps: keyed lookup with collision and load costs
- Hash sets: fast membership without an order promise
