Q. What is a Stack? What basic operations can be performed on them?


Answer =

Stack is a basic data structure where insertion and deletion of data takes place at one end called the top of the Stack, i.e., it follows the last in, first out (LIFO) principle.

In Python, a Stack is generally implemented with lists.

Following basic operations can be performed on Stacks.

(i) PUSH, i.e., insertion of element in the Stack
(ii) POP, i.e., deletion of an element from the Stack
(iii) Displaying all the elements in the Stack.

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post