Stack is the data structure that can be logically through as Linear Data Structure. The basic implementation is called as LIFO ( Last In First Out ) way.
There are three operation can be perform in a stack data structure.
- Push ( Insertion of an element )
- Pop ( Deletion and return of top element )
- Peek (Return of top element, just pick and see what it is.)
Before going to the implementation lets look a Demo by Y. Daniel Liang.