NotesByLex

Abstract Data Type

An Abstract Data Type (ADT) is a data type defined by its behaviour, meaning the values it can hold and the operations you can perform on it, rather than by how it's implemented.

For example, a Stack is an ADT defined by its operations (push, pop and peek). It could be implemented with an array or a linked list, and code using the stack shouldn't need to care which. A Queue is another example.

Separating the interface from the implementation means you can swap implementations (for example, to improve performance) without changing the code that uses them.