Math, asked by reddysunil659, 13 days ago

What is stack ADT? Why it is known as LIFO? Write algorithm with Example Program?​

Answers

Answered by Speedy75
3

A stack is an Abstract Data Type (ADT), commonly used in most programming languages. ... Likewise, Stack ADT allows all data operations at one end only. At any given time, we can only access the top element of a stack. This feature makes it a LIFO data structure.

LIFO is short for “Last In First Out”. The last element pushed onto the stack will be the first element that gets popped off. If you were to pop all of the elements from the stack one at a time then they would appear in reverse order to the order that they were pushed on.

Abstract Data Type(ADT) is a data type, where only behaviour is defined but not implemented. Opposite of ADT is Concrete Data Type (CDT), where it contains an implementation of ADT. Examples: Array, List, Map, Queue, Set, Stack, Table, Tree, and Vector are ADTs

Similar questions