What is a Stack?

An introduction to the stack data structure, its uses, and its functionality.

Introduction

Everyone is familiar with the famous undo option, which exists in almost all popular applications. But have you ever wondered how that works? Well, store the previous states of your work (which are limited to a specific number) in the memory in such an order that the last one appears first. You can’t efficiently do this with simple arrays for reasons explored in the coming chapters. This is where the “stack” data structure ...