Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 5

Ayan Avro Biswas

ROLL NO.: 18700120056


DEPARTMENT: CSE
YEAR: 3rd
BATCH: 2020-2024
REGISTRATION NO.:
SUBJECT: COMPAILER DESIGN
Introduction to ADT
In this article, we will learn about ADT but before understanding what ADT is let us
consider different in-built data types that are provided to us. Data types such as int ,
float, double, long, etc. are considered to be in-built data types and we can perform
basic operations with them such as addition, subtraction, division, multiplication, etc.
Now there might be a situation when we need operations for our user-defined data type
which have to be defined. These operations can be defined only as and when we require
them. So, in order to simplify the process of solving problems, we can create data
structures along with their operations, and such data structures that are not in-built are
known as Abstract Data Type (ADT).
Abstract Data type (ADT) is a type (or class) for objects whose behavior is defined by a
set of values and a set of operations. The definition of ADT only mentions what
operations are to be performed but not how these operations will be implemented. It
does not specify how data will be organized in memory and what algorithms will be
used for implementing the operations. It is called “abstract” because it gives an
implementation-independent view. 
The process of providing only the essentials and hiding the details is known as
abstraction. 
What is abstract data type?
An abstract data type is an abstraction of a data structure that provides only the
interface to which the data structure must adhere. The interface does not give any
specific details about something should be implemented or in what programming
language.
Skip Ad
In other words, we can say that abstract data types are the entities that are definitions of
data and operations but do not have implementation details. In this case, we know the
data that we are storing and the operations that can be performed on the data, but we
don't know about the implementation details. The reason for not having
implementation details is that every programming language has a different
implementation strategy for example; a C data structure is implemented using
structures while a C++ data structure is implemented using objects and classes.
For example, a List is an abstract data type that is implemented using a dynamic array
and linked list. A queue is implemented using linked list-based queue, array-based
queue, and stack-based queue. A Map is implemented using Tree map, hash map, or
hash table.
Abstract data type model
Before knowing about the abstract data type model, we should know about abstraction and
encapsulation.
Abstraction: It is a technique of hiding the internal details from the user and only showing
the necessary details to the user.
Encapsulation: It is a technique of combining the data and the member function in a single
unit is known as encapsulation.

The above figure shows the ADT model. There are two types of models in the ADT model,
i.e., the public function and the private function. The ADT model also contains the data
structures that we are using in a program. In this model, first encapsulation is performed,
i.e., all the data is wrapped in a single unit, i.e., ADT. Then, the abstraction is performed
means showing the operations that can be performed on the data structure and what are the
data structures that we are using in a program.
THANK YOU

You might also like