User Tools

Site Tools


lifo_computing

LIFO (computing)

Return to FIFO (computing), Stack, Call stack, Stack-based memory allocation, Stack frame, Stack (abstract data type), Stack unwinding

Also called: Last in, first out

The order in which an element added to the stack (Stack (abstract data type) or an element removed from the stack is described as last in, first out, referred to by the acronym LIFO. By contrast, a queue (Queue (abstract data type)) operates first in, first out, referred to by the acronym FIFO (computing and electronics).

Snippet from Wikipedia: Stack (abstract data type)

In computer science, a stack is an abstract data type that serves as a collection of elements with two main operations:

  • Push, which adds an element to the collection, and
  • Pop, which removes the most recently added element.

Additionally, a peek operation can, without modifying the stack, return the value of the last element added. The name stack is an analogy to a set of physical items stacked one atop another, such as a stack of plates.

The order in which an element added to or removed from a stack is described as last in, first out, referred to by the acronym LIFO. As with a stack of physical objects, this structure makes it easy to take an item off the top of the stack, but accessing a datum deeper in the stack may require removing multiple other items first.

Considered a linear data structure, or more abstractly a sequential collection, a stack has one end which is the only position at which the push and pop operations may occur, the top of the stack, and is fixed at the other end, the bottom. This data structure makes it possible to implement a stack as a singly linked list and as a pointer to the top element. A stack may be implemented to have a bounded capacity. If the stack is full and does not contain enough space to accept another element, the stack is in a state of stack overflow.

A stack is needed to implement depth-first search.

Memory management: Dynamic memory management, C language memory management, C dynamic memory allocation - C memory (malloc, realloc, calloc, C free, mimalloc), C++ memory (automatic storage duration, C++ auto, RAII), C# memory, Binary prefixes (kilo-mega-giga-tera-peta-exa-zetta-yotta), Manual memory management, Memory management (operating systems) (Linux memory - UNIX memory, Android memory, IBM mainframe memory, iOS memory, macOS memory, Windows memory), Memory: Memory address, Address space, Memory allocation - Memory allocator, Bash memory, Memory deallocation - Deallocation, Memory debugger (Memwatch, mtrace), Memory diffusion, Dynamic memory, Memory fence (Memory barrier), Memory fragmentation] - Fragmentation, Free list, Garbage collection - Garbage collector, Golang memory, Heap or Free store (Heap-based memory allocation), Stack (Call stack - Stack-based memory allocation - Stack (abstract data type) - LIFO (computing) - Stack frame - Stack unwinding), JVM memory (Java memory - Kotlin memory - Scala memory), Memory leak, Memory model, Memory paging, Out of memory, Page (computer memory), Pointers, C language pointers, Automatic pointer, Pointer swizzling, Memory pool, Memory protection, Physical memory, PowerShell memory, Python memory, RAM, Memory reference (Reference counting - Soft reference - Weak reference), Resource allocation (Resource Acquisition Is Initialization - RAII), Resource leak, Rust memory, Memory segmentation, Memory utilization, Shared memory, Static variable - Automatic variable, Virtual memory, Virtual address space. Memory management. (navbar_memory_management. See also navbar_memory or navbar_data_storage)


Cloud Monk is Retired (for now). Buddha with you. © 2005 - 2024 Losang Jinpa or Fair Use. Disclaimers

SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.


lifo_computing.txt · Last modified: 2022/09/28 19:03 by 127.0.0.1