Stack is ADT which has three features/functions/behavior/properties:
1. Push
2. Pop
3. Top/Peek
and this behavior is governed by LIFO principle.
Implementations:
1. Array
Pros: Each Operation is O(1).
Cons: There is an upperbound on the size of stack ( use arraylist for this problem)
2. LinkedList
Pros:
Cons: