Question: Consider the Elevator algorithm. The elevator is currently at floor 5 and its direction is up when the following requests arrive: 3 , 7 ,

Consider the Elevator algorithm. The elevator is currently at floor 5 and its direction is up when the following requests arrive: 3,7,5,4,6,2(a) In which order will these requests be processed? (Separate the numbers by commas.)
The elevator algorithm contains the following condition: if ((position destination)||(position==destination) && (direction=-up)) upsweep.wait(destination) else downsweep.wait(-destination)
Assume the condition is simplified as follows: if ((position destination) upsweep.wait(destination) else downsweep.wait(-destination)
(b) In which order will the same requests be processed?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!