Glossary termConcept

Data Structure

Way of organizing and storing data in a computer so that it can be accessed and modified efficiently, such as an array, list, tree or hash table.

A data structure is a particular arrangement of data in memory, together with the operations it supports. An array stores items in consecutive slots, so any element can be reached directly by its position. A linked list chains items together with pointers, making insertion cheap but lookup by position slow. Stacks and queues restrict access to one end or the other, trees organize data hierarchically and hash tables map keys to values for very fast lookup. Each structure trades off speed, memory use and simplicity in a different way.

Choosing a data structure is closely tied to choosing an algorithm, a relationship captured in the title of Niklaus Wirth's 1976 book "Algorithms + Data Structures = Programs". Computer scientists distinguish an abstract data type, which specifies behavior (a queue lets items be added at the back and removed from the front), from a concrete data structure that implements it, such as a queue built on an array or on a linked list. Barbara Liskov's work on abstract data types in the 1970s helped establish this separation, which underlies the design of most standard libraries.

Most programs rely on well-tested data structures supplied by a language's standard library rather than building their own, but understanding their costs remains essential. Searching an unsorted list takes time proportional to its length, while a balanced tree or hash table can answer the same query far faster, a difference that becomes decisive with millions of records. Specialized structures sit inside everyday systems: B-trees organize data in databases and file systems; graphs model networks and routes; Merkle trees verify data in version control systems and blockchains.

Key points

  • Each data structure offers a different balance of access speed, insertion cost, memory use and complexity.
  • An abstract data type defines which operations are available, while a data structure defines how they are implemented.
  • Niklaus Wirth's 1976 book title summed up the close relationship between algorithms and data structures.
  • Large systems depend on specialized structures, such as B-trees in databases and Merkle trees in version control.

Related entries

Glossary term

Algorithm

ProgrammingAI

Finite sequence of well-defined steps for solving a problem or performing a computation, such as sorting a list or finding a route.

Glossary term

Hash Table

Programming

Data structure that stores key-value pairs and uses a hash function to compute where each item lives, giving very fast average lookups.

Glossary term

Hierarchical data structure of nodes connected by edges, with a single root and no cycles, used for file systems, indexes and parsers.

Glossary term

Graph Theory

ProgrammingIdeas and Culture

Branch of mathematics that studies networks of nodes connected by edges, used to model relationships from road maps to social networks.

Glossary term

Big O Notation

Programming

Mathematical notation describing how an algorithm's running time or memory use grows as its input size grows, ignoring constant factors.

Glossary term

Pointer

Programming

Variable that stores the memory address of another value, letting programs refer to data indirectly and build linked structures.

Glossary term

Merkle Tree

BlockchainProgramming

Tree data structure in which each non-leaf node holds a hash of its children, enabling efficient and secure verification of large data sets.

Person

Barbara Liskov

Programming

American computer scientist whose work on data abstraction, the CLU language and fault-tolerant distributed systems shaped modern programming practice.

Featured in guides

Referenced by

Other entries that discuss or point to Data Structure.