Answer:
Difference between Queue and Stack are as following:-
- Queue is a FIFO(First In First Out) type data structure while Stack is a LIFO(Last In First Out) type data structure.
- The insertion and deletion of elements from the queue happens from two ends insertion at the tail and deletion from the front.While the insertion and deletion from stack happens from one end only that is top.
- The insertion and deletion operation in queue are referred as enqueue and dequeue. While in stack they are referred as push and pop respectively.