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.