answersLogoWhite

0

Why does a stack have Last in First out configuration?

Updated: 8/20/2019
User Avatar

Wiki User

11y ago

Best Answer

If you imagine a stack as a pile of dinner plates then, if you want to remove a plate the only one you can remove is the one at the top of the pile. Similarly if you want to add a dinner plate the only place you can put it is at the top of the pile.

Thus using a stack the process of dealing with its contents it is like the pile of dinner plates the one you get to deal with first is the last one you placed in the pile and so on - last in first out!.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why does a stack have Last in First out configuration?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Why does not use FIFO in stack?

A FIFO, or First In First Out is a queue.A stack is a LIFO or Last In First Out.


What is LIFO in Data Structure?

LIFO stands for Last In First Out. Ex: Stack


What is a stack and how do you represent a stack in computer memory also discuss basic operation performed on a stack?

A stack is an abstraction of First-in-last-out, or the last in first out. The basic operations (may bear different names) Push or Add Pop or Next


How is the stack and stack pointer work?

A stack is a data structure in which last item inserted is taken out first . That's why they are known as LIFO (last in first out). Inserting an item in stack is termed as push and taking an item out from stack I s termed as pop. Stack pointer is the pointer that points to the top of the stack or that points the item at the top of the stack and help in adding or deleting the item from the top of stack.


What makes up a stack?

A stack is usually a sequential series of instructions of any reasonable length. Access to a stack can be FIFO(First In First Out), LIFO (Last In First Out) or by access to any point in the stack by use of a pointer.


What is difference between stack snd queue?

In stack , the object which is last in will be first out (LIFO), whereas in queue the object which is first in will be first out (FIFO).


What is the function of the stack counter?

Its not a stack counter - its a stack pointer. The stack pointer is a register that points to the top of the stack. In the Intel configuration, it points to the next item to be popped off the stack. To push an item requires that the stack pointer be decremented first, and then the item is written. The inverse operation - the pop - requires read then increment.


Can stack be called fifo data structure?

No. A stack is a LIFO (Last In First Out) data structure.A queue is a FIFO (First In First Out) data structure.


What is the meaning of popping in computer programming?

Popping is the opposite of pushing. You push values into a queue and pop them off. The queue is generally represented by a stack, where the last value pushed onto the stack is the first to be popped off the stack (last in first out, or LIFO).


Can stack be as a pointer?

A stack is a data structure in which last item inserted is taken out first . That's why they are known as LIFO (last in first out). Inserting an item in stack is termed as push and taking an item out from stack I s termed as pop. Stack pointer is the pointer that points to the top of the stack or that points the item at the top of the stack and help in adding or deleting the item from the top of stack.


Stack register are used to store?

The stack register contains the address of the last item pushed on the stack. The stack is a region of memory used for temporary storage of instruction addresses and register values in a Last-In-First-Out (nested) structure. It is used for interrupts and subroutine calls.


Why is the queue data structure called a LIFO?

It isn't! A queue is a FIFO structure, not a LIFO structure. FIFO is an acronym for First-In, First-Out and is analogous with first come, first served (as per a queue of people waiting to be served). LIFO is an acronym for Last-In, First-Out, which is analogous with a stack structure, where the last element added is always placed on top of the stack while the top-most element of the stack is always the first to be removed from the stack.