Intro

An abstract data type (ADT) is a theoretical model that describes a datatype’s behavior (operations) without specifying its implementation.

ADTs define:

  • A set of values
  • A set of operations
  • The behavioral rules of those operations
img
  • 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)

Abstraction

https://algs4.cs.princeton.edu/12oop/

ADTs provide:

  • Abstraction — only essential operations are exposed
  • Encapsulation — data and operations are bundled conceptually
  • Data Independence — implementations can change without affecting usage

Data Structures

A Data Structure is a concrete implementation of an ADT. It defines how data is organized, stored, and accessed, and determines the efficiency of operations like insertion, deletion, and lookup.