A Stack is a linear data structure which follows Last In First Out (LIFO) principles,in which both insertion and deletion occur at only one end of the list called the 'Top'.
Operations on Stack: The fundamental operations performed on stack are
- Push
- Pop
1. Push :
The process of inserting a new element
to the top of the stack. for every push operation the top is incremented by
one.
2. Pop:
The process of deleting an element from the top of the stack is called pop operation .after every pop operation the top pointer is decremented by 1.
No comments:
Post a Comment