LIFO
From Wikipedia, the free encyclopedia
This article is about LIFOs in computing. For LIFO in accounting, see FIFO and LIFO accounting. For LIFO in organizational training, see Life Orientations Training.
LIFO stands for last in, first out which in computer science and queueing theory refers to the way items stored in a data structure are processed. The last data to be added to the structure will be the first data to be removed. LIFO mechanisms include data structures such as stacks. Sometimes the term FILO ("first in, last out") is used synonymously.
A LIFO structure can be illustrated with the example of a crowded elevator. When the elevator reaches its destination, the last people to get on are typically the first to get off.
LIFO is also a term used in accounting, for example in determining the cost basis for inventory, and cost of goods sold. See FIFO and LIFO accounting.
[edit] See also
- Depth first search
- FIFO (First in, first out)
- Stack Data Structure