What’s difference between Stack and Queue?
What’s difference between Stack and Queue?
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.
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.
Bookmarks