Skip to content

Structure Selection Heuristics

Choosing the right data structure requires analyzing access patterns (read/write ratio), operation frequency, data characteristics (size, ordering needs), and constraints (memory, latency) - no structure is universally optimal.

Tension Addressed

All tensions

Recognizable As

Architecture decision records; "ArrayList vs. LinkedList" debates; database schema design discussions; any "which collection should I use?" analysis

Canonical Sources

Skiena, The Algorithm Design Manual (1998); McConnell, Code Complete, Chapter 12 (2004)

Transfers To

System Design (component selection), Database Design (schema decisions), API Design (return type selection), Performance Engineering (optimization)

Key heuristics: - Default to arrays/vectors for general use (cache-friendly, simple) - Use hash tables when key-based lookup dominates - Use trees when ordering or range queries matter - Use specialized structures only when profiling indicates need