19.7k views
3 votes
A simple algorithm for handling requests works like this:________ a) all requests users make are stored. b) The elevator prioritizes the requests that are on the way where it’s going, but also based on a first come first served principle. c) It is up to you how you design the algorithm.

User Mtyurt
by
4.7k points

2 Answers

6 votes

Answer:

Answer is B. The elevator prioritizes the requests that are on the way where it’s going, but also based on a first come first served principle.

Refer below.

Step-by-step explanation:

A simple algorithm for handling requests works like this:

The elevator prioritizes the requests that are on the way where it’s going, but also based on a first come first served principle.

User George Wiscombe
by
5.2k points
3 votes

Answer:

b) The elevator prioritizes the requests that are on the way where it’s going, but also based on a first come first served principle.

Step-by-step explanation:

Elevator routing often looks complex, as the elevator has to decide whether to go to the person who has waited the longest or the one who is closest? There are also issues of how long should the rider spend.

A simple algorithm can be designed where the elevator prioritizes the requests that are on the way where it’s going, but also based on a first come first served principle. Once it exhausts the request in its current direction, it then switches directions if there are requests in that direction. This way the elevator is able to tackle the complex issue based on the simple algorithm.

User Databyte
by
4.7k points