Applications of Queue Data Structure
Queue is used when things don’t have to be processed immediatly, 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.
- Find number of days between two given dates
- How to print maximum number of A’s using given four keys
- Write an iterative O(Log y) function for pow(x, y)
- Visa Interview Experience | Set 6 (On-Campus)
- Count number of ways to reach a given score in a game
- Greedy Algorithm for Egyptian Fraction
- Find length of period in decimal value of 1/n
- How to check if an instance of 8 puzzle is solvable?