LIFO
Last in, first out: the ordering rule of a stack, where the newest item is always the next to leave.
In more detail
LIFO order is what you want when the most recent thing must be handled first, such as closing the innermost open bracket or undoing the last edit. It is the opposite of FIFO.
Related terms
- stack — A collection where the last item added is the first one removed, like a pile of plates.
- FIFO — First in, first out: the ordering rule of a queue, where the oldest item is always the next to leave.
Taught in
- Stacks And Queues: Last In Or First In — Algorithms & Data Structures for Working Engineers