Last In, First Out

phrase

say it: “LAST IN, FURST OWT” /læst ɪn fɜrst aʊt/

The rule that the item added most recently is the first one taken out.

What is last in, first out (LIFO)?

Last in, first out, or LIFO (said "LIE-foe"), is the rule a stack follows: the most recently added item is the first one removed, like the top plate on a pile. Undo follows it: the newest change comes undone first.

In a sentence

  • “Undo follows last in, first out: your newest change is the first to come undone.”

Level: Apprentice · More Data Structures terms at this level

Updated