Queue is used when things don’t have to be processed immediately, but have to be processed in First In First Out order like Breadth First Search. This property of Queue makes it also useful in following kind of scenarios.
1) When a resource is shared among multiple consumers. Examples include CPU scheduling, Disk Scheduling.
2) When data is transferred asynchronously (data not necessarily received at same rate as sent) between two processes. Examples include IO Buffers, pipes, file IO, etc.
See this for more detailed applications of Queue and Stack.
- Applications of Priority Queue
- Circular Queue | Set 1 (Introduction and Array Implementation)
- Implementation of Deque using circular array
- Queue Interface In Java
- Deque | Set 1 (Introduction and Applications)
- Priority Queue | Set 1 (Introduction)
- Queue | Set 2 (Linked List Implementation)
- Queue | Set 1 (Introduction and Array Implementation)
- Find the first circular tour that visits all petrol pumps
- Implement Stack using Queues
- Find the largest multiple of 3 | Set 1 (Using Queue)
- LRU Cache Implementation
- Check whether a given Binary Tree is Complete or not | Set 1 (Iterative Solution)
- Sliding Window Maximum (Maximum of all subarrays of size k)
- Queue using Stacks