Stacks
A stack is a collection in which insertions and deletions happen at one end only, called the top. The element removed is always the one inserted most recently: last in, first out (LIFO). A stack of plates is the usual picture.
Data Structures · topic
Stack operations and their costs in array and linked implementations, two stacks in one array, balanced brackets, recursion and the call stack, valid pop sequences and Catalan counts, and infix, prefix and postfix conversion and evaluation with full stack traces.
A stack is a collection in which insertions and deletions happen at one end only, called the top. The element removed is always the one inserted most recently: last in, first out (LIFO). A stack of plates is the usual picture.
Arithmetic expressions are usually written in infix form, a + b, with the operator between its operands. Infix needs precedence rules, associativity rules and parentheses to be unambiguous.
One-page visual sheets for this topic, in the sheet library on the store. Previews are free; the full sheets come with the subject pack.