STACK
The stack is a data structure that operates as a last-in-first-out (LIFO) structure
LIFO (Last In First Out)
Imagine that you have a stack of books on your desk. The books are stacked on top of each other in a certain order, with the bottom book being the first one you put on the stack and the top book being the last one you added.
This is like a LIFO system, because the last book you added (the top one) is the first one you can take off the stack. So if you want to grab a book from the middle of the stack, you have to take off the top few books first and then you can reach the one you want.
the "top" of the stack is at the lowest memory address, and the "bottom" is at the highest memory address
Last updated