Introduction to the Stack

What is a stack?

A stack is a simple computational device with two operations: push and pop.

That allows us to pile up data to remember using the LIFO (last in, first out) method and quickly retrieve the last piled data item as shown below:

Get hands-on with 1200+ tech skills courses.