PDA

View Full Version : What’s difference between Stack and Queue?



Shivangi Panwar
05-30-2016, 12:20 AM
What’s difference between Stack and Queue?

priya01
05-30-2016, 12:30 AM
Stack and Queue both are used as placeholder for a collection of data. The primary difference between a stack and a queue is that stack is based on Last in First out (LIFO) principle while a queue is based on FIFO (First In First Out) principle.

pxljobs
08-24-2016, 02:42 AM
In the stack object are inserted and removed in the same end,this follow Last in First Out technique,the stack operation called push and pop,stacks are visualized vertical collections.
In the queue object are inserted and removed in same end,queue following First in first out method,the queue operation is called enqueue and dequeue,queue are visualised horizontal collections.