Applications of Queue Data Structure

1.3

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.

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

GATE CS Corner    Company Wise Coding Practice

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.

Recommended Posts:



1.3 Average Difficulty : 1.3/5.0
Based on 96 vote(s)










Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.