answersLogoWhite

0


Best Answer

Think about what each concept means.

A FIFO (First In, First Out) stack is like a supermarket queue - people are served in the order in which they arrive in line. You'd use a FIFO stack for a process that requires sequential access to data in arrival order, such as transaction processing.

On the other hand, a LIFO (Last In, First Out) stack is like an elevator - the people who board last are nearest the front, so they're the first off in "processing" order. You might use a LIFO stack for something like expression parsing. For example, if you're trying to match up parens, you need to use the "nearest match" rule. That means if you have already stacked two "("s you'd want to pair the most recently-scanned one with the first closing ")" encountered and evaluate the enclosed expression. That means the ")" would pair off with the "(" at the top of your paren stack rather than the bottom; i.e. LIFO.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

16y ago

thE EXAMPLE OF LINEAR DATA STRUCTURE THAT ARE UNDER LIFO FIFO:::::;;;\ LIFO:-------->>>>> STACK FIFO:-------->>>>>>> QUEUE

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

The java.util.Stack class (and any subclasses) will use the last-in-first-out mechanism.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: With data structures what are the implementations of using LIFO and FIFO?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Why does LIFO order follows in stack and why does FIFO order follows in queue?

LIFO and stack are synonyms, so are FIFO and queue.


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.


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 FIFO approach?

FIFO is the acronym for First In First Out, which means Use (or do) the Oldest Stuff First, or use things in the order of their arrival. Two common contexts for this are in accounting and computing. FIFO is also used in inventory and in stocking shelves where the items that are received first should be used first and old items are shelved in front and new items in the back. It is a materials management technique in Warehousing, Fruit & Vegetable stores, Butcher shops, etc. and handling incoming mail in offices. It is all about making sure things flow through a system properly, where older items are used before items that have just come in. Technically, FIFO is a means of describing a queue-like data sequence, where insertions (push operations) occur at the end of the sequence and extractions (pop operations) occur at the beginning of the sequence. As opposed to a LIFO (last-in, first-out) sequence where all pushes and pops occur at the end of the sequence, thus creating a stack-like data sequence. LIFO can also be called FILO (first-in, last-out), which means the same thing. In other words, with FIFO, we pop objects off the sequence in the same order they were pushed onto it, but with LIFO/FILO we pop objects in the reverse order they were pushed.


What is LIFO in Data Structure?

LIFO stands for Last In First Out. Ex: Stack