A stack is a one-ended linear data structure which models a real world stack by having two primary operations, namely push and pop. Stack is known to have Last-in-First-out (LIFO) structure.

Time Complexity of Stack
Size: O(1)
Pushing: O(1)
Popping: O(1)
Peeking: O(1)
Searching: O(n)
Examples
•
Brackets Validator
•
Tower of Hanoi






