Data Structure¶
Core Idea¶
A data structure is a way of organizing information so that some operations become cheap at the structural cost of others. The commitment is arrangement-for-use: there is no neutral storage, because every layout privileges some access pattern and penalizes the rest. Choosing a structure is choosing what will be cheap and what expensive, justified by what the system will actually do with the information, not by any property of the information itself.
How would you explain it like I'm…
How You Arrange Your Toys
Some Jobs Easy, Others Hard
Arrangement For Use
Broad Use¶
- Computer science: arrays, hash tables, search trees, and heaps each optimize a different operation profile — random access, lookup, ordered traversal, priority extraction.
- Libraries and archives: card catalogs and finding aids privilege search-by-author, browse-by-subject, or trace-the-provenance differently.
- Bureaucracies: the org chart and case-numbering scheme optimize escalation and audit at the expense of cross-team collaboration.
- Logistics: warehouse and SKU layouts privilege some pick-and-pack operations; a high-velocity item in a hard-to-reach bin is a mismatch.
- Law: statutory titles and sections are a data structure over the body of law, periodically recodified.
- Science: a shift from Linnaean to phylogenetic taxonomy is a data-structure migration that privileges different reasoning operations.
Clarity¶
It makes a hidden choice visible: "this filing system is bad" almost always means an operation-profile mismatch, not a storage problem. It separates capacity (anything can hold it) from access (how cheaply operations run).
Manages Complexity¶
A well-chosen layout turns a linear or quadratic operation into a logarithmic or constant one without changing the information at all, and structures compose — an index over a corpus inherits both components' profiles.
Abstract Reasoning¶
It supplies reusable templates — operation-profile thinking, amortized-versus-worst-case reasoning, invariants as the glue, layering and indexing — each stated in terms of cost profiles rather than any substrate.
Knowledge Transfer¶
- CS → institutions: asking "what does this org chart make cheap and expensive?" is data-structure analysis, with re-index and restructure porting directly.
- CS → research: a slip-box or tag graph is a data structure over one's reading corpus that decides which research operations are cheap.
- CS → maintenance: re-indexing a database has analogues in organizational re-cataloguing and scientific taxonomy revision — re-arrangement driven by operation-profile drift.
Example¶
Storing integers for lookup, insert, and range-query: a hash table gives expected \(O(1)\) lookup but \(O(n)\) range-query because hashing destroys order; a balanced search tree gives \(O(\log n)\) lookup and \(O(\log n + k)\) ranges. Neither is "better" — each privileges some operations and penalizes the rest, and layering a hash index over the tree buys both at the cost of space.
Relationships to Other Abstractions¶
Current abstraction Data Structure Prime
Parents (1) — more general patterns this builds on
-
Data Structure presupposes, typical Trade-offs Prime
A data_structure is the arrangement-for-use trade — privileging some operations cheap at the structural cost of penalizing others (the no-neutral-arrangement invariant).
Children (10) — more specific cases that build on this
-
Data store Domain-specific is a kind of Data Structure
The proposed strict upward parent is
prime:data_structure. -
Disjoint-Set Data Structure Domain-specific is a kind of Data Structure
Data Structure is the proposed immediate parent.
-
EDA database Domain-specific is a kind of Data Structure
The proposed strict upward parent is
prime:data_structure. -
Hash Table Domain-specific is a kind of Data Structure
A hash table is a data structure specialized to content-derived bucket addressing and an expected-amortized constant-time point-lookup profile.
-
Heap Domain-specific is a kind of Data Structure
A heap is a data structure specialized to a partial-order invariant that keeps one extreme cheap under continuous insertion and extraction.
- Neural Turing machine Domain-specific is a kind of Data Structure
The proposed strict upward parent is `prime:data_structure`.
- Quotient Filter Domain-specific is a kind of Data Structure
Quotient Filter is strictly **subsumed by `prime:data_structure`**.
- Table (Information) Domain-specific is a kind of Data Structure
**Data Structure** is the umbrella instantiated directly: a table makes lookup and exact comparison cheap while imposing header-maintenance, navigation, and conversion costs.
- Tagged union Domain-specific is a kind of Data Structure
The proposed strict upward parent is `prime:data_structure`.
- Tree (Data Structure) Domain-specific is a kind of Data Structure
A tree data structure is an arrangement-for-use whose invariants make recursive traversal and height-bounded operations cheap at other costs.
Hierarchy path (1) — routes to 1 parentless root
- Data Structure → Trade-offs → Constraint
Not to Be Confused With¶
- Data Structure is not an Abstract Data Type because an ADT specifies which operations exist and what they mean (the contract), whereas a data structure is the concrete arrangement that fixes what those operations cost.
- Data Structure is not a Schema because a schema specifies the shape and validity of data, whereas a data structure specifies the layout that makes operations efficient; two systems can share a schema yet use different structures.
- Data Structure is not an Ontology because an ontology commits to what kinds of things exist, whereas a data structure commits to how information is arranged for cheap access; the same ontology admits many structures.