What is an abstract data type?

Stephen M. Walker II · Co-Founder / CEO

What is an abstract data type?

An Abstract Data Type (ADT) is a mathematical model for data types, defined by its behavior from the point of view of a user of the data. It is characterized by a set of values and a set of operations that can be performed on these values. The term "abstract" is used because the data type provides an implementation-independent view. This means that the user of the data type doesn't need to know how that data type is implemented, they only need to know what operations can be performed on it.

ADTs are a way of classifying data structures based on how they are used and the behaviors they provide. They do not specify how the data structure must be implemented or laid out in memory, but simply provide a minimal expected interface and set of behaviors. Examples of ADTs include list, stack, and queue, among others.

The concept of ADTs is closely related to the principle of data abstraction, which is a key component of object-oriented programming. Data abstraction involves providing only essential information to the outside world while hiding implementation details. This approach enhances usability and makes the software design more robust, as internal changes do not affect external interfaces.

ADTs were first proposed by Barbara Liskov and Stephen N. Zilles in 1974, as part of the development of the CLU language. Since then, they have become a fundamental concept in computer science, used in various programming languages and paradigms.

What are some examples of abstract data types?

Abstract Data Types (ADTs) are a way of classifying data structures based on their behavior and the operations that can be performed on them, without specifying how they are implemented. Here are some examples of ADTs:

  1. List — A List is a collection of items where each item holds a relative position with respect to the others. It can be implemented using arrays or linked lists.

  2. Stack — A Stack is a linear data structure that follows a particular order in which operations are performed. The order may be LIFO (Last In First Out) or FILO (First In Last Out). It can be implemented using arrays or linked lists.

  3. Queue — A Queue is a linear structure which follows a particular order in which operations are performed. The order is First In First Out (FIFO). It can be implemented using arrays or linked lists.

  4. Deque (Double-ended Queue) — A Deque is a generalized version of Queue data structure that allows insert and delete at both ends.

  5. Associative Array (Dictionary, Hash Map) — An Associative Array is a collection of key-value pairs where each key is unique. It can be implemented using hash tables.

  6. String — A String is a sequence of characters. It is an immutable ADT in many programming languages.

  7. Class and Object — In object-oriented programming, a class defines a new data type where the data and the operations on the data are bundled together as a self-contained unit. An object is an instance of a class.

  8. Integer — The Integer ADT is a discrete, unlimited, linearly ordered set of instances. It is a built-in data type in many programming languages.

These are just a few examples, and there are many other ADTs used in various programming paradigms. The choice of ADT depends on the specific requirements of the software being developed.

What are the characteristics of an abstract data type?

An abstract data type (ADT) is a conceptual model that defines a data type purely by the operations it supports and how users perform these operations, rather than by its internal composition. This level of abstraction ensures that the ADT can be implemented in multiple ways, providing flexibility while maintaining a consistent user interface.

What are the benefits of using an abstract data type?

Abstract data types (ADTs) in AI define data by behavior, not structure, allowing for versatile implementations. They simplify complex data structures and algorithm design, improving efficiency in data organization and access. ADTs' adaptability is key in various AI applications, enabling more efficient development and operations.

How are abstract data types implemented?

An abstract data type (ADT) is defined by its behavior, so it can be implemented in multiple ways. For example, a list can be implemented with arrays or linked lists, and a map can be implemented with hash tables or balanced trees.

In practice, ADTs are implemented as modules or classes that expose a stable set of operations while hiding internal representation details. This approach keeps the interface consistent even when the underlying data structure changes.

More terms

Continue exploring the glossary.

Learn how teams define, measure, and improve LLM systems.

Glossary term

Transformer Architecture

A Transformer is a type of deep learning model that was first proposed in 2017. It's a neural network that learns context and meaning by tracking relationships in sequential data, such as words in a sentence or frames in a video. The Transformer model is particularly notable for its use of an attention mechanism, which allows it to focus on different parts of the input sequence when making predictions.
Read term

Glossary term

Computational Neuroscience

Computational Neuroscience is a field that leverages mathematical tools and theories to investigate brain function. It involves the development and application of computational models and methodologies to understand the principles that govern the structure, physiology and cognitive abilities of the nervous system.
Read term

It's time to build

Collaborate with your team on reliable Generative AI features.
Want expert guidance? Book a 1:1 onboarding session from your dashboard.

Talk to sales