Stack is a linear data structure which follows a particular order in which the operations are performed. The order may be LIFO(Last In First Out) or FILO(First In Last Out).
Operations
Creating Stack DS:
Inserting new Element
Inserting new element
Pop(Deleting an Element)
Peek()
Display()
Application of stack
Balancing Parenthesis
Example
Recursion (Unit 3)
Recursion are implemented using stack
Eg. Consider the following program segment to find the factorial of a number using recursion