4.3.1 Stacks

In This lesson, you are going to explore the Stack. Stacks are built like a limited vector in that they store a list of items, but unlike a vector, you only have access to the top of the stack.

You can think of a stack like a stack of books. Every time you add to the pile, the pile gets bigger, but you can only access the top book.

As a result, stacks are considered a Last-in, First-out data structure. The last item you put into the stack is the first item you take out.

Last updated