Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > Java

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 05-30-2016, 12:15 AM   #1
Shivangi Panwar
Registered User
 
Join Date: Nov 2015
Posts: 127
What’s difference between Stack and Queue?

What’s difference between Stack and Queue?
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Shivangi Panwar is offline   Reply With Quote

Old 06-06-2016, 10:13 PM   #2
SaraSanjay
Registered User
 
Join Date: May 2016
Posts: 551
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.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
SaraSanjay is offline   Reply With Quote
Old 06-11-2016, 06:06 AM   #3
Paavni
Registered User
 
Join Date: Jun 2016
Posts: 15
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".
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Paavni is offline   Reply With Quote
Old 07-06-2016, 01:35 AM   #4
Kiara
Registered User
 
Join Date: Jun 2016
Location: USA
Posts: 55
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.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Kiara is offline   Reply With Quote
Old 07-13-2016, 10:52 PM   #5
rekhaweb
Registered User
 
Join Date: Jul 2016
Posts: 28
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.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
rekhaweb is offline   Reply With Quote
Old 07-20-2016, 05:19 AM   #6
sashwatmegh
Registered User
 
Join Date: Apr 2016
Location: pune
Posts: 583
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.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
sashwatmegh is offline   Reply With Quote
Old 08-29-2016, 02:38 AM   #7
addisoncave
Registered User
 
Join Date: Jun 2016
Posts: 169
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.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
addisoncave is offline   Reply With Quote
Old 09-10-2016, 03:51 AM   #8
hillajax
Registered User
 
Join Date: Aug 2016
Location: Salt Lake City, Utah, United States
Posts: 7
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.
hillajax is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:26 PM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.