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.
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.
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:
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:
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:
RELATED TAGS
CONTRIBUTOR
View all Courses