why stack is called abstract data type.If stack is adt , then how to implement stack?

19,590

From Wikipedia:

Abstract data types are purely theoretical entities, used (among other things) to simplify the description of abstract algorithms, to classify and evaluate data structures

In computer science, a data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently

One way of describing the stack is as a last in, first out (LIFO) abstract data type and linear data structure. A stack can have any abstract data type as an element, but is characterized by two fundamental operations, called push and pop (or pull).

So, it can be concluded that Abstract Data Types are theoretical but when realized are called data structures.

To be more clear:

A data type can be considered abstract when it is defined in terms of operations on it, and its implementation is hidden (so that we can always replace one implementation with another for, e.g., efficiency reasons, and this will not interfere with anything in the program).

Share:
19,590

Related videos on Youtube

user1849655
Author by

user1849655

Updated on September 15, 2022

Comments

  • user1849655
    user1849655 over 1 year

    Stack is called as abstract data type, which is nothing but an interface.Then why stack comes under data structures topic.Is this a data structure or abstract data type?Is both are same or different?

  • user1849655
    user1849655 over 11 years
    Stack is abstract data type because it hides how it is implemented like using array or linked list.But it organizes data for efficient management and retrieval so it a data structure also.Am I taking it in the right way?