Abstract Data Types
This addresses M1SO1 of the CS Unit 2 syllabus
Edu Level: Unit2
Date: Aug 6 2026 - 8:00 PM
⏱️Read Time:
ABSTRACT DATA TYPES (ADT)
- Abstract Data Types are models for data types
- They store collections of data
- They are accompanied by functions that perform operations on the data
- ADTs are created for use by programmers
- Programmers manipulate the collections of data
- ADTs are used to model collections of data in real world scenarios
COMPONENTS OF AN ADT
State
- Container of items itself
- Information about the container of items
- Includes size of the container
- Includes reference to the first item in the list
Operations
- Define how data in the ADT can be manipulated
- Examples include insertion, deletion, searching, and traversal
- Specify valid actions without showing how they are carried out
Implementation
- Actual coding structures that realize the ADT
- Examples include arrays, linked lists, or pointers
- Hidden from the user who only interacts with the abstract behaviour
DATA TYPES
- Describes the kind of data a variable can store
- Defines the operations that can be performed on that data (e.g. a char cannot be added to a number or multiplied by a number)
TYPES OF DATA TYPES
Primitive Data Types
- Basic, predefined types built into the programming language
- Directly supported by hardware
- Examples include int, float, char, double, boolean
Non-Primitive Data Types
- Derived from primitive data types
- Allow storage and manipulation of multiple values
- Examples include arrays, strings, structures, classes, pointers
DATA STRUCTURES
- Define how data is organized and stored for efficient access and modification
- Classified as linear or non-linear
Linear Data Structures
- Elements arranged sequentially
- Each element connected to its previous and next element
- Examples include Stacks, Queues, Linked Lists
Non-Linear Data Structures
- Elements connected hierarchically
- Allow multiple paths and relationships
- Examples include Trees, Graphs
TYPES OF ADTs
- Stacks
- Linked Lists (singly linked lists)
- Queues
- Circular Queues