Queue is a linear data structure which follows a FIFO(First In First Out) order.Classic example of queue can be a line in front of a bank cashier to deposit or withdraw money.
The primary difference between a stack and queue is that Stack is (Last In First Out) piling of data. Whereas as Queue is First In First Out.
Queue data structure has two pointers.One being the front and other pointing the rear.
Operations of Queue:
- Enqueue
- Dequeue
Queue can be implemented using :
- Array
- Linked list
Both have their own advantages or disadvantages.
Applications of Queue:
- CPU scheduling & Disk Scheduling
- IO buffers or asynchronous transfer
More Links to follow.