What is a queue?and give three applications of a queue
Answers
Answer:
Queue is the line of someone or something.
- Trees planted in a queue or in query
- Students stand in query
- Vehicles on the roads
Explanation:
Applications of Queue data structure
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.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.This Algorithm uses Queue data structure.
5.Handling of interrupts in real-time systems. The interrupts are handled in the same order as they arrive, First come first served.
6.In real life, Call Center phone systems will use Queues, to hold people calling them in an order, until a service representative is free.....