A stack is one of the elementary data structure which is based on the LIFO property – Last In First Out.

Example: a stack of books.


In this structure, you can either push or remove your book from only one direction .i.e. top. And the last pushed book will be only which needs to be removed.


Removing anything from the stack is called pop operation and adding anything to a stack is called Push operation. And, we can perform these two operations only on one end – top.

See the following video if you want more clarity about the stack.


Please enter your comment!
Please enter your name here