Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

data structures
data types

What are abstract data types?

Hafiza Farwa Mahmood

Abstract data types classify the types of data structures along with the predefined operations within the language. As their name implies, it doesn't specify how data types are implemented because their implementation is hidden.

Each data type in ADT is ready to use and has basic operations like insertion, deletion, or updating. So programmers need to know which operation an ADT can perform rather than worrying about its inner details.

Note: Abstract data types are based on primitive data types. If you want to know more about primitive data types, click here.

Types of ADT

ADTs allow users to effectively implement complex mathematical and logical programs as they are flexible and independent of language. There are three types of ADTs.

  • List
  • Queue
  • Stack
%0 node_1 Abstract Data Type node_2 List node_1->node_2 node_3 Queue node_1->node_3 node_4 Stack node_1->node_4
Types of ADT

List

The list ADT is a sequential combination of one or more than one element. Each element has its positional value and a referential pointer to the next element. Users can't access elements randomly, so the head pointer is initialized to the first element of the list.

Basic operations of the list are as follows:

Operations of List

Queue

The queue is a linear ADT which allows insertion from one end and deletion from another. As per the name, It works on the FIFO (first in, first out) principle. The queue has two ends, front and rear. The rear end is used for insertion, and the front end is used for deletion.

The basic operations of the queue are as follows:

Operations of Queue

Stack

A stack is a linear ADT that restricts users from inserting and deleting elements from only one end, known as the top of the stack. It uses LIFO (last in, first out) as its basic working principle. The top of the queue always has a recently inserted element.

Basic operations of the stack are as follows:

Stack operations

RELATED TAGS

data structures
data types
RELATED COURSES

View all Courses

Keep Exploring