Question: QUEUE and STACK QUESTION Would the below applications be suitable for a queue or a stack? Why? In each case, what are the benefits of
QUEUE and STACK QUESTION
Would the below applications be suitable for a queue or a stack? Why? In each case, what are the benefits of choosing one method over another? In your responses to other students, please discuss whether you agree with your classmates selections and suggest additional options that might work as well.
1. An ailing company wants to evaluate employee records so as to lay off some workers 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.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
