0% found this document useful (0 votes)
6 views1 page

Abstract Data Type

Abstract Data Types (ADTs) are defined by a set of values and operations, with the implementation details hidden from the user. Examples of ADTs include Stack and Queue, each with specific operations such as checking if they are full or empty, adding or removing elements, and retrieving the size. The operations for Stack include push, pop, and peek, while Queue operations include insert and delete.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Abstract Data Type

Abstract Data Types (ADTs) are defined by a set of values and operations, with the implementation details hidden from the user. Examples of ADTs include Stack and Queue, each with specific operations such as checking if they are full or empty, adding or removing elements, and retrieving the size. The operations for Stack include push, pop, and peek, while Queue operations include insert and delete.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Abstract Data Type

The abstract datatype is special kind of datatype, whose behavior is defined by a set of values
and set of operations. The keyword “Abstract” is used as we can use these datatypes, we can
perform different operations. But how those operations are working that is totally hidden from the
user. The ADT is made of with primitive datatypes, but operation logics are hidden.
Some examples of ADT are Stack, Queue, List etc.
Let us see some operations of those mentioned ADT −

 Stack −
o isFull(), This is used to check whether stack is full or not
o isEmpry(), This is used to check whether stack is empty or not
o push(x), This is used to push x into the stack
o pop(), This is used to delete one element from top of the stack
o peek(), This is used to get the top most element of the stack
o size(), this function is used to get number of elements present into the stack
 Queue −
o isFull(), This is used to check whether queue is full or not
o isEmpry(), This is used to check whether queue is empty or not
o insert(x), This is used to add x into the queue at the rear end
o delete(), This is used to delete one element from the front end of the queue
o size(), this function is used to get number of elements present into the queue

You might also like