Two fundamental operations performed on the stack are PUSH and POP.  

[Stack class 12] Operations on Stack - Computer Science - Teachoo - Concepts

Push Operation on Stack

PUSH adds a new element at the TOP of the stack. It is an insertion operation. 

We can add elements to a stack until it is full. A stack is full when no more elements can be added to it. Trying to add an element to a full stack results in an exception called ‘overflow’. 

Pop Operation on Stack

POP operation is used to remove the top most element of the stack, that is, the element at the TOP of the stack. It is a delete operation

We can delete elements from a stack until it is empty i.e. there is no element in it. Trying to delete an element from an empty stack results in an exception called ‘underflow’.

Remove Ads
Teachoo · Class 12 Explore Class 12
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh is an IIT Kanpur graduate and has been teaching for 16+ years. At Teachoo, he breaks down Maths, Science and Computer Science into simple steps so students understand concepts deeply and score with confidence.

Many students prefer Teachoo Black for a smooth, ad-free learning experience.