Indicate whether each of the following applications would be suitable for a queu
ID: 3567357 • Letter: I
Question
Indicate whether each of the following applications would be suitable for a queue and why:
1. An ailing company wants to evaluate employee records so as to lay off some worker on the basis of service time (the most recently hired employees are laid off first).
2. A program is to keep track of patients as they check into a clinic, assigning them to doctors on a first come, first served basis.
3. A program to solve a maze is to backtrack to an earlier position(the last place where a choice was made) when a dead-end position is reached.
4. An inventory of parts is to be processed by part number.
5. An operating system is to process requests for computer resources by allocating the resources in the order in which they are requested.
Explanation / Answer
1. Employees are evaluated based on first come first serve so queue is suitable.
2. Again the same, first come first server so queue is suitable
3. In this, last in first out approach will be used, i.e stack not queue to keep track of choices.
4.No, list needs to be sorted with parts number and then used.
5. Yes queue can be used as resources are allocated on first come first serve basis.