Everything Totally Explained


Ask & we'll explain, totally!
LIFO
Totally Explained


  NEW! All the latest news in the worlds of computer gaming, entertainment, the environment,  
finance, health, politics, science, stocks & shares, technology and much, much, more.  


View this entry using RSS

Everything about Lifo totally explained

LIFO is an acronym which stands for last in, first out. In computer science and queueing theory this refers to the way items stored in some types of data structures are processed. By definition, in a LIFO structured linear list, elements can only be added or taken off from only one end, called the "top". A LIFO structure can be illustrated with the example of a narrow, crowded elevator with a small door. When the elevator reaches its destination, the last people to get on have to be the first to get off.

Definition

The term in computing generally refers to the abstract principles of list processing and temporary storage, particularly when there's a need to access the data in limited amounts, and in a certain order. LIFO is most used in cases where the last data added to the structure must be the first data to be removed or evaluated. A useful analogy is of the office worker: a person can only handle one page at a time, so the top piece of paper added to a pile is the first off; parallel to limitations such as data bus width and the fact one can only manipulate a single binary data address in a computer at a time). The abstract LIFO mechanism, when applied to computing inevitably devolves to the real data structures implemented as stacks whose eponymous relation to the "stack of paper", "stack of plates" should be obvious. Other names for the device are "Push down list" and "piles" The term FILO ("first in, last out") can be used synonymously, as the term emphasizes that early additions list need to wait until they rise to the LIFO structure "top" to be accessed. The difference between a generalized list, an array, queue, or stack, is defined by the rules enforced and used to access the mechanism. In any event, a LIFO structure is accessed in opposite order as a queue, "There are certain frequent situations in computer science when wants to restrict insertions and deletions so that they can only take place at the beginning or end of the list, not in the middle. Two of the data structures useful in such situations are stacks and queues."

Use

Stack structures in computing are extremely fundamental and important. It is fair to say that without the ability to organize data by order rearrangement, including links to executable code, computers wouldn't be the flexible tools they're today, and exist solely as expensive special purpose calculators like the ENIAC of World War II having limited abilities and scope of application.
   In such data orderings, the stack is used as a dynamic memory element wherein an abstract concept—a machine dependent Stack frame is used to contain copies of data records or parts thereof—be they actual memory addresses of a data element (See parameters pass-by-reference), or a copy of the data (pass-by-value). In list processing, the most common need is sorting (alphabetically, greatest to smallest, etcetera.) where the machine is limited to comparing only two elements at a time, out of a list that likely holds millions of members. Various strategies (computer algorithms) exist which optimize particular types of data sorting, but in implementation all will resort to a sub-program and or sub-routines that generally call themselves or a part of their code recursively in each call adding to the list temporarily reordered in stack frames. It is for this reason, stacks and recursion are usually introduced in parallel in data structures courses—they are mutually interdependent.
   It is through the flexibility of this access to data by stack-frames with their data re-groupings (in abstract a LIFO organized block of data which seems only to allow data some improvement on ordering flexibility) that sub-programs and sub-routines receive their input, do the task they're optimized to perform, and pass information back to the program segment currently in charge. The stack frame in actual cases includes the address of the next instruction of the calling program segment, which ordinarily then does something with the data "answer" processed by the subroutines or subprogram. In a recursive call, this is generally an instruction to check the next list element versus the returned "answer" (for example largest of the last two compared), until the list is exhausted.
   Consequently, in real world implementations of the LIFO abstraction, the number of stack frames varies extremely often, each sized by the needs of the data elements that need manipulated. This can be likened to a LIFO pile of booklets or brochures, rather than a thin sheet of paper.

Further Information

Get more info on 'Lifo'.


External Link Exchanges

Do you know how hard it is to get a link from a large encyclopaedia? Well we're different and will prove it. To get a link from us just add the following HTML to your site on a relevant page:

    <a href="http://lifo.totallyexplained.com">LIFO Totally Explained</a>

Then simply click through this link from your web page. Our crawlers will verify your link, extract the title of your web page and instantly add a link back to it. If you like you can remove the words Totally Explained and embed the link in article text.
   As long as your link remains in place, we'll keep our link to you right here. Please play fair - our crawlers are watching. Your site must be closely related to this one's topic. Any kind of spamming, dubious practises or removing the link will result in your link from us being dropped and, potentially, your whole site being banned.



Copyright © 2007-8 totallyexplained.com | Licensed under the GNU Free Documentation License | Site Map
This article contains text from the Wikipedia article LIFO (History) and is released under the GFDL | RSS Version