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.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Applications of Priority Queue
- Design a Queue data structure to get minimum or maximum in O(1) time
- Stack and Queue in Python using queue Module
- Check if a queue can be sorted into another queue using a stack
- Reversing a Queue using another Queue
- Difference between Circular Queue and Priority Queue
- Difference between Stack and Queue Data Structures
- Deque | Set 1 (Introduction and Applications)
- Different Types of Queues and its Applications
- Find the largest multiple of 3 | Set 1 (Using Queue)
- Queue Interface In Java
- Implement a stack using single queue
- Circular Queue | Set 1 (Introduction and Array Implementation)
- Circular Queue | Set 2 (Circular Linked List Implementation)
- Queue - Linked List Implementation
- Queue | Set 1 (Introduction and Array Implementation)
- Priority Queue | Set 1 (Introduction)
- Queue based approach for first non-repeating character in a stream
- Reversing a Queue
- Implement Stack and Queue using Deque