Stack: Stack is a "last in, first out" (LIFO) data structure. It contains a pointer to the top node and its size.
Stack Node: It contains the data and a pointer to the next stack node. Its information is shown in a rectangle. The label below the rectangle shows the associated memory address
API Explanation:
1. Push: Add a new node at the end - O(1)
2. Pop: Remove the last node - O(1)
3. Clear Stack: Clear the entire stack