A Stack is a linear data structure that follows the LIFO (Last-In-First-Out) principle.In other
words, a stack can be defined as a container in which insertion and deletion can be done from the
one end known as the top of the stack.
Time complexity : O(1)