Skip to main content

Stack

Data Structures

A last-in, first-out (LIFO) collection.

A stack is a data structure where elements are added (pushed) and removed (popped) from the same end, so the most recently added item is removed first. Stacks model function call frames, undo histories, and expression evaluation.

← Back to full glossary