Implementation of Stack Data Structure
Pre-requisites :
- A working knowledge of pointer operations
- Some idea about what a stack, linked list etc is
Whatever the operation may be(insertion or deletion) has to be performed at the top.
You can visualize it as something like this.
A more real life example would be this
You can remove a plate from top and add only at the top. Or to be more precise it follows the LIFO(Last in first out) rule
Some operations which we can be performed are
- push
- pop
- top(gives the element at the top of the stack)
- IsEmpty ( tells whether the stack is empty or not ! )
Something relevant.
Hope it helped. Stay tuned for more!
No comments:
Post a Comment