The short answer
An abstract data type (ADT) describes what you can do with a collection of data: the kinds of values it holds, the operations it supports, and what those operations should do. A data structure is a concrete way to store and organize that data in memory so the operations can run.
Put simply, an ADT is a specification and a data structure is an implementation. A stack shows the idea well. Its ADT says you can push an item, pop the most recent one, and look at the top without removing it. An array or a linked list can be the data structure that makes those rules work.
What an abstract data type is
An ADT lists three things:
- Values: the kinds of data it holds, such as items waiting in a line.
- Operations: what you can do with the data, such as adding, removing or looking up an item.
- Behavior: what each operation returns or changes, including edge cases such as popping from an empty stack.
An ADT says nothing about how the items are laid out in memory. That is deliberate. Barbara Liskov and Stephen Zilles introduced the idea in a 1974 paper on programming with abstract data types, and it has influenced how many languages separate an interface from its implementation.
Common ADTs include:
- List: an ordered collection with access by position
- Stack: last in, first out
- Queue: first in, first out
- Set: unique items with membership checks
- Map (dictionary): key-value pairs, looked up by key
- Priority queue: removes the item with the highest priority first
What a data structure is
A data structure is the concrete layout behind an ADT. Common examples include:
- Array: items in consecutive slots, reached by index
- Linked list: nodes that each hold a value and a pointer to the next node
- Hash table: items placed according to a hash of their key
- Binary heap: a tree-shaped structure stored in an array, often used for priority queues
- Binary search tree: nodes arranged so that a search can skip large parts of the data
Each layout makes some operations fast and others slower. An array gives quick access by index but can be costly to insert into the middle. A linked list makes insertion at a known position cheap but makes access by index slow.
A worked example: the stack
Suppose you need a stack. The stack ADT defines the operations first:
push(x): add an item to the toppop(): remove and return the top itemtop()(orpeek()): return the top item without removing itis_empty(): report whether the stack has any items
The core stack operations in data structure courses all follow the last-in, first-out rule. The ADT doesn’t say how to store the items, so there are at least two good options.
Array-based. Keep the items in an array and track where the top is. Pushing and popping at the end are constant-time operations on average. A resizable array occasionally has to grow, which is why the cost is usually described as amortized constant time.
Linked-list-based. Each node holds a value and a pointer to the node below it. Pushing creates a new node at the head, and popping removes the head. Both operations are constant time.
Code that uses the stack calls push and pop the same way in either case. That is the point of the ADT.
One ADT, several data structures
The same ADT can be built in more than one way, and the difference shows up in cost. Java has a List interface, which is an ADT. Its two common implementations are ArrayList, backed by a resizable array, and LinkedList, built from nodes. Both support adding and removing items. Reading an item by index is constant time in ArrayList, but it takes linear time in LinkedList, because the list must be walked from the start.
A dictionary ADT shows the same pattern. A hash table usually gives average constant-time lookups, while a balanced search tree gives logarithmic lookups and keeps keys in sorted order. The ADT is the same, and the trade-offs differ.
Why the distinction matters
- Design: you can state what your program needs before you decide how to store it.
- Performance: the cost of each operation depends on the data structure, so the same ADT can run at different speeds. Comparing those costs with big o for data structures makes the trade-off concrete.
- Swapping: code that depends only on the ADT can switch to a different data structure without changes to its callers.
- Study: exam questions often ask you to implement an ADT, while interview questions often ask which data structure to use. Knowing both makes the answers clearer.
Where the terms get blurred
People often say “data structure” for both ideas. In everyday conversation that is fine. Precision matters when you are writing code or answering a course question, so it helps to know which one you mean.
Some language features blur the line further. A Python list behaves like a list ADT, and in the standard CPython implementation it is stored as a dynamic array. Built-in types also don’t always map cleanly to ADTs. If you are also sorting out primitive vs non primitive data types, that is a separate split: it is about the kinds of values a language provides, not about how a collection is organized.
Learners often ask is an array a data structure. The answer is yes: an array is a concrete way to lay out elements. It can also back an ADT such as a list or a stack, so the same thing can play either role depending on the level you are looking at.
Summary
- An ADT defines the values, operations and behavior. It answers “what”.
- A data structure defines how the data is stored. It answers “how”.
- One ADT can be built from several data structures, each with its own costs.
- When someone asks about a stack, a queue or a map, first identify the ADT, then ask which data structure it uses.