Abstract Data Type in Data Structure with Example
An Abstract Data Type (ADT) is a theoretical model that defines a set of operations and their behavior, without specifying how those operations are implemented internally. It separates what a data structure does from how it does it.
Why ADTs Matter
- They provide a clear contract for using a data structure without needing to know its internal implementation.
- They allow implementation details to change (e.g., array-based vs linked-list-based) without affecting code that uses the ADT.
- They promote abstraction and modularity in software design.
Example: Stack ADT
The Stack ADT defines operations like push(item), pop(), peek(), and isEmpty(), along with the rule that elements are removed in LIFO order. It can be implemented using an array or a linked list — both are valid as long as they honor the ADT's contract.
Example: List ADT
The List ADT defines operations such as insert(index, item), remove(index), get(index), and size(). It can be implemented as a dynamic array or a linked list.
Common ADTs
| ADT | Typical Operations |
|---|---|
| Stack | push, pop, peek, isEmpty |
| Queue | enqueue, dequeue, front, isEmpty |
| List | insert, delete, get, size |
| Map/Dictionary | put, get, remove, containsKey |
Key Takeaway
ADTs are a design-level concept, while data structures like arrays, linked lists, and trees are the concrete implementations used to realize those ADTs.
Ready to master Data Structures & Algorithms?
Learn DSA hands-on with mentor-led sessions, real interview practice, and placement support.
.png)