Stack
Stack
(50 point)>>Dastan
Write pseudocode for the Stack data structure with operations Push, Delete, Stack-empty .Give
example. Analyze Stack data structure. What policy does Stack implement? Obtain running time
for operations.
>>>
Definition:
Stack is a linear data structure which operates in a LIFO(Last In First Out) or FILO (First In
Last Out) pattern.
It is named stack as it behaves like a real-world stack, for example – a deck of cards or a pile of
plates, etc.
Stack is an abstract data type with a bounded (predefined) capacity.
It is a simple data structure that allows adding and removing elements in a particular order.
The order may be LIFO(Last In First Out) or FILO(First In Last Out).
Conclusion:
Stack is a very useful data structure with many uses. It is an essential part of every program as all
the programming languages internally use stack for function calls and many more operations. To
summarize , the time and space Complexities of Stack are: