Please help me to build a list of examples of stack and queue in real life situation...

Conditions:
The object concerned must only one object.
And the object must be tangible.

Example:
Queue (FIFO): The bullet in a machine gun..(you cannot fire 2 bullets at the same time)
Stack (LIFO): The tennis balls in their container.. (you cannot remove 2 balls at the same time)

Please help me I need more examples..
At least 10 examples


TNX :)

Recommended Answers

All 18 Replies

This is an assignment for you to do, so do your own damn homework.

This is an assignment for you to do, so do your own damn homework.

Seconded.

For a queue just think of stuff where something goes in one end and out the other in order. For a stack just think of stuff where something goes in one end and out the same end in order.

commented: Sorry you missed the chess tournament. +9

image a stack as a pile of plates requiring washing in a resturant kitchen

Hi example for queue can be Queue for booking movie tickets (FIRST IN FIRST OUT)

stack- a stack of books
queue- a print queue, a bus queue

Routers can use queues. I'd elaborate but if you want to use it as an example, it'll force you to research it first to figure out the correct terminology/phrasing for an example.

You can use the billing counter as an example. The first person on the line gets the chance to pay first so he comes out of the counter first.

Real life examples of queue are: 1. A queue of people at ticket-window: The person who comes first gets the ticket first. The person who is coming last is getting the tickets in last. Therefore, it follows first-in-first-out (FIFO) strategy of queue.
2. Vehicles on toll-tax bridge: The vehicle that comes first to the toll tax booth leaves the booth first. The vehicle that comes last leaves last. Therefore, it follows first-in-first-out (FIFO) strategy of queue.
3. Phone answering system: The person who calls first gets a response first from the phone answering system. The person who calls last gets the response last. Therefore, it follows first-in-first-out (FIFO) strategy of queue.
4. Luggage checking machine: Luggage checking machine checks the luggage first that comes first. Therefore, it follows FIFO principle of queue.
5. Patients waiting outside the doctor's clinic: The patient who comes first visits the doctor first, and the patient who comes last visits the doctor last. Therefore, it follows the first-in-first-out (FIFO) strategy of queue.

if many processes are waiting for CPU time , then processes are made to wait in a queue. they get the cpu time acc to fifo order or first come first serve.

4 years old post...

check this out for more info on queue data structure
http:\ba-programmer.blogspot.com

For Queue(FIFO)-inbox messages in our mobile phone.

Can i get real life example of stack for making simulation

Plz give some example of real life in which data structure are use

Stack is a linear data structure in which item insertion or deletion takes place at only one place called TOP.
Stack is also called as LIFO or restricted list.
What is LIFO ?

LIFO - Last In First Out
It is the principle which specifies that the data item that is inserted last into the stack is the first one to be deleted from the stack.

Example :

Stacks in data structures
We can relate stacks to some real life objects and situations, as you can see in the picture of stack of books,
One can add a new book to an existing stack of books only at its top and no where else. Similarly a book cannot be added in the middle of the stack so one has to remove all the books above to add a new book at desired place.

For more information and programs on stacks and explanation visit
Program2Do

plz what are real applications of stack and queue

pls i wanted to know the practical examples of stack in computer field , and not like plates, books...blah....blah...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.