Pick the structure whose most frequent operations are cheapest for your access pattern. Start by listing the operations you'll perform, estimate their frequency, then match them to a structure's strengths.
A decision checklist
text
1. How do you access data? by index -> array
by key -> hash map
by order -> tree / heap
2. Need ordering? sorted -> balanced BST / sorted array
FIFO -> queue
LIFO -> stack
3. Frequent middle inserts? -> linked list
4. Need fast "seen it?" -> set / hash map
5. Need "best/min/max next" -> heap (priority queue)
