Abstract Data Types (original) (raw)
Last Updated : 31 Jan, 2026
Abstract Data Type (ADT) is a conceptual model. They define what a data structure does without dictating how it does it. By separating the logical properties from the physical implementation, ADTs allow for cleaner, more maintainable code.

As depicted in the diagram, the following features of ADTs are highlighted:
- Only the essentials are exposed, omitting implementation details (Abstraction).
- Data and its related operations are bundled into a single unit (Encapsulation).
- You can change the underlying implementation (e.g., from an Array to a Linked List) without affecting how the rest of the program uses the ADT (Data Independence).
Common Examples of ADTs:
While ADTs define the logical model for data handling, several standard structures exemplify this concept. The following examples adhere to the ADT principle by providing specific operations while concealing the underlying storage logic.
**Queue: A linear structure following the FIFO (First In, First Out) principle.

- enqueue(value): Adds element to the bottom.
- dequeue(): Removes top element
- peek(): Returns top element.
**List: A sequential collection of elements.

- insert(value,index): Adds element to the given position.
- remove(value,index): Removes element from given position.
- get(index): Returns value at given position.
**Stack: A linear structure following the LIFO (Last In, First Out) principle.

- push(value) : Adds element to the top.
- pop(): Removes top element.
- peek(): Returns top element.
Differences Between ADTs and UDTs
Abstract Data Types (ADTs) define what operations are allowed, while User Defined Types (UDTs) define how data is stored and implemented.
| Abstract Data Types (ADTs) | User-Defined Data Types (UDTs) |
|---|---|
| Focuses on allowed operations and their behaviour, without implementation details. | Focuses on how data is organized in memory and how operations are executed. |
| Provides an abstract model for defining data structures conceptually. | Allows programmers to create concrete implementations of data structures using primitive types. |
| Does not define the implementation of operations or data structure. | Specifies how to create and organize data types for implementing the structure. |
| List, Stack, Queue | Classes, Structs, Enumerations |
Advantages
- Modularity: Simplifies complex systems by breaking them into smaller, manageable pieces.
- Security & Integrity: Information hiding prevents unauthorized or accidental modification of internal data.
- Reusability: Once defined, the interface can be reused across different projects regardless of the backend logic.
Disadvantages
- Performance Overhead: The layers of abstraction can sometimes lead to slightly higher memory or CPU usage.
- Initial Complexity: Designing a robust ADT requires more upfront planning and a steeper learning curve for beginners.