LIFO

From Wikipedia, the free encyclopedia

Jump to: navigation, search

LIFO is an acronym that stands for "last in, first out", also known as FILO ("first in, last out") and may refer to:

[edit] Also

  • The First In Last Out, a pub in Hastings so-called because it was the first pub on the way in to town on the main road, and the last pub on the way out.

LIFO and FILO are the same. Both mean the most recent entry is the next to be processed, and the oldest is the last to be processed. Imagine a stack of cards built by placing one card on top of the next. Now imagine pulling the cards off the stack, one at a time. The most recently placed card (LI, or Last In) is the first to be removed (FO, or First Off), and thus we have LIFO. Similarly, the first card that was placed in building the stack (FI, or First In) will be the last card (LO, or Last Off) to be picked back up when destacking the stack, and thus we have FILO. Thus, LIFO and FILO are the same.