A data structure is a way of organizing data in a computer’s memory so that the operations a program needs to perform on it can be done efficiently. Common examples include arrays, linked lists, stacks, queues, trees, hash tables, and graphs. Each arranges data differently, and each makes some operations fast while making others slow.
The choice of data structure often determines how fast an algorithm runs. The same task can take very different amounts of time depending on how the data is stored: searching an unsorted list means checking items one by one, while a balanced search tree or a hash table can find the same item far more quickly. Algorithms and data structures are therefore studied together, because picking the right structure is frequently the key to an efficient solution.
This pairing is reflected in the very organization of the field’s foundational texts. Donald Knuth’s The Art of Computer Programming devotes its first volume, Fundamental Algorithms, to basic data structures alongside the algorithms that operate on them, treating the two as inseparable parts of a single subject.
Data structures matter because real computers have finite, organized memory. A structure is, in effect, a chosen arrangement of stored information together with the set of operations it supports efficiently, and choosing well is one of the central skills of programming.