Tuesday 16 February 2016

Applications of Queue Data Structure

Queue data structure is used when things have to be processed in First In First Out order.

1) Queue is useful in CPU scheduling, Disk Scheduling. When multiple processes require CPU at the same time, various CPU scheduling algorithms are used which are implemented using Queue data structure.

2) When data is transferred asynchronously between two processes.Queue is used for synchronization. Examples : IO Buffers, pipes, file IO, etc.

3) Print Spooling.In print spooling, documents are loaded into a buffer and then the printer pulls them off the buffer at its own rate. Spooling also lets you place a number of print jobs on a queue instead of waiting for each one to finish before specifying the next one.

4) Breadth First search in a Graph .It is an algorithm for traversing or searching  graph data structures. It starts at some arbitrary node of a graph and explores the neighbor nodes first, before moving to the next level neighbors.

1 comment: