Site Owners Forums - Webmaster Forums

Site Owners Forums - Webmaster Forums (http://siteownersforums.com/index.php)
-   Java (http://siteownersforums.com/forumdisplay.php?f=12)
-   -   What’s difference between Stack and Queue? (http://siteownersforums.com/showthread.php?t=169800)

Shivangi Panwar 05-30-2016 12:15 AM

What’s difference between Stack and Queue?
 
What’s difference between Stack and Queue?

SaraSanjay 06-06-2016 10:13 PM

Queues and Stacks are used as containers to hold objects and retrieve them out in a specific order, which facilitates different types of operations. A Stack operates as a First In Last Out (FILO) container while a Queue operates as a First In First Out (FIFO) container.

Paavni 06-11-2016 06:06 AM

In stack insertion and deletion of items can be done only on one end that is "TOP".
In queue insertion can be done in one end called "REAR" and deletion is done at the other end called "FRONT".

Kiara 07-06-2016 01:35 AM

In a stack, objects are inserted and removed at the same ends. In a queue, objects are inserted and removed at the different ends.
Stack follows Last in first out order. Queue follows first in first out.

rekhaweb 07-13-2016 10:52 PM

A stack is a collection of elements, which can be stored and retrieved one at a time. Elements are retrieved in reverse order of their time of storage, i.e. the latest element stored is the next element to be retrieved.
A queue is a collection of elements, which can be stored and retrieved one at a time. Elements are retrieved in order of their time of storage, i.e. the first element stored is the next element to be retrieved.

sashwatmegh 07-20-2016 05:19 AM

The stack is a container of objects that are inserted and removed according to the (LIFO) principle.
The queue is a container of objects (a linear collection) that are inserted and removed according to the (FIFO) principle.

addisoncave 08-29-2016 02:38 AM

Stack and queue both are data structure that we used in programming to control the flow of data in efficient way. Stack act like a box of cardboard in which the First cardboard piece that have stored can be only retrieve in last. But Queue is a box which has also tore from the bottom, in this 1st piece of cardboard will retrieve first.

hillajax 09-10-2016 03:51 AM

Stack act as a A Room that has only one door and the person who enter in this room along with other people will be last to leave the room. But Queue is like cave that has two ending with one enter and one exit gate and arranged in such way that first one who has enter in this cave will be first to leave the cave through exit gate.


All times are GMT -7. The time now is 09:31 AM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.