NCERT Solutions for class 12 Computer Science Stack is provided here. Stacks are dynamic data structures that follow the (LIFO) Last In First Out principle. The last item which was inserted in the stack will be the first item to be deleted from it.
You have a stack of plates on a table. The plate at the top of the stack is the first item to be moved if anyone requires a plate from that stack.
Deleting and Inserting Elements in a Stack
There are certain rules for deletion and insertion of an element. Elements can be deleted or inserted only from one side of the stack, that is from the top. The operation of deletion and insertion of elements are called pop() and push().
Visit the below download link to download the PDF of NCERT solutions for class 12 Computer Science Stack