What is abstract data type ? Support your answer with example.
What is abstract data type ? Support your answer with example.
Abstract Data Type (ADT)
An Abstract Data Type (ADT) is a type of data structure that defines what operations can be performed on the data but does not specify how these operations are implemented.
ADT focuses on what to do, not how to do it.
It hides the implementation details and shows only the necessary operations to the user. This concept is based on abstraction in programming.
Key Features of ADT
- Defines data and operations together
- Hides internal implementation
- Improves security and modularity
- Makes programs easier to maintain
Example 1: Stack as an ADT
A Stack follows LIFO (Last In First Out) principle.
Operations Defined:
- push() → Insert element
- pop() → Remove element
- peek() → View top element
- isEmpty() → Check if stack is empty
Here, the user only knows these operations.
The stack may be implemented using:
- Array
- Linked List
But the implementation is hidden.
User does not know how memory is managed internally.
Example 2: Queue as an ADT
A Queue follows FIFO (First In First Out) principle.
Operations:
- enqueue()
- dequeue()
- front()
Again, implementation may use:
- Array
- Linked List
But only operations are exposed.
Conclusion
An Abstract Data Type defines the logical behavior of a data structure without revealing its internal working.
Examples of ADT:
- Stack
- Queue
- List
- Set
Thus, ADT provides abstraction and makes programming more organized and secure.





















