## 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:

- Ukkonen’s Suffix Tree Construction – Part 1
- Print all increasing sequences of length k from first n natural numbers
- Find n’th number in a number system with only 3 and 4
- Minimum Cost Polygon Triangulation
- Mobile Numeric Keypad Problem
- How to efficiently implement k Queues in a single array?
- Analysis of Algorithm | Set 5 (Amortized Analysis Introduction)
- Print squares of first n natural numbers without using *, / and -

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