## Applications of Queue Data Structure

Queue is used when things don’t have to be processed immediatly, but have to be processed in **F**irst **I**n **F**irst **O**ut 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.

**References:**

http://introcs.cs.princeton.edu/43stack/

### Related Topics:

- Calculate the angle between hour hand and minute hand
- Dynamic Programming | Set 37 (Boolean Parenthesization Problem)
- Find the smallest number whose digits multiply to a given number n
- Write a function that generates one of 3 numbers according to given probabilities
- Horner’s Method for Polynomial Evaluation
- Count trailing zeroes in factorial of a number
- Program for nth Catalan Number
- Backtracking | Set 8 (Solving Cryptarithmetic Puzzles)

Writing code in comment?Please useideone.comand share the link here.