STL Stack
!! Standard Template Library (STL) provides a set of programming tools to implement algorithms and data
structures like vectors, lists, queues, etc.
Operation Description
push() adds an element into the stack
pop() removes an element from the stack
top() returns the top element of the stack
size() returns the number of elements in the stack
empty() returns true if the stack is empty
isfull() returns true if the stack is full else false.
isfull() gets the value of the top element without removing it
!! Note: Unlike vectors or other containers, we cannot use a ranged for loop to iterate through a
stack. This is because the STL stack is an STL Container Adapter, which provides restrictive
access to make it behave like a standard stack data structure.