Which one of the following is an application of queue data structure?
2022
Which one of the following is an application of queue data structure?
- A.
When a resource is shared among multiple consumers
- B.
When data is transferred asynchronously between two processes
- C.
Load balancing
- D.
All of the above
Attempted by 804 students.
Show answer & explanation
Correct answer: D
A queue is a data structure that follows the First In, First Out (FIFO) principle. It is used in scenarios where elements are processed in the order they arrive.
Option A: When a resource is shared among multiple consumers, a queue ensures that each consumer gets access in the order they requested. This prevents starvation and ensures fairness.
Option B: In asynchronous data transfer between processes, data is often buffered. A queue stores incoming data until the receiving process is ready, maintaining the order of arrival.
Option C: Load balancing distributes tasks among multiple servers. A queue can manage incoming tasks, ensuring each server processes them in the order they were received.
Since all individual options describe valid applications of a queue, the correct choice is 'All of the above'.