๐Ÿ“˜

Stack

A pile where the last thing added is the first taken out.

๐Ÿ˜Š In simple words

A pile where the last thing added is the first taken out.

๐ŸŽ“ Technical definition

A last-in, first-out (LIFO) data structure with push (add to top) and pop (remove from top) operations.

Pseudocode example
1SET PLATES = []2ADD "red" TO PLATES3ADD "blue" TO PLATES4DISPLAY POP(PLATES)   // blue

๐ŸŽ Real-world analogy

A stack of plates in a cupboard.

๐Ÿ”— Related concepts

โ† Whole glossary