Question: 1 . Describe the problem. 2 . Design an algorithm as a pseudo code to solve this problem. 3 . Describe the type of your

1. Describe the problem.
2. Design an algorithm as a pseudo code to solve this problem.
3. Describe the type of your algorithm (dynamic programming, greedy, ...) and
analyze the time complexity for this algorithm.
4. The output obtained as a result of executing your implemented algorithm in
Java.
1: (Elevator Optimization) Assume that you work in a very tall building with a
slow elevator. The elevator is frustratingly interrupted when people press buttons
for many neighboring floors during a trip. Encountering interruptions during an
upward journey becomes especially frustrating when individuals press buttons for
several neighboring floors, like 13,14, and 15. The ascent is repeatedly
interrupted three times, once at each of these floors. A more considerate
approach would be for those passengers to collectively agree to press only the
button for floor 14. Subsequently, individuals on floors 13 and 15 could opt to use
the stairs for a single floor, taking advantage of the opportunity to walk. We
presume that the cost of ascending a flight of stairs is equivalent to descending
considering the health benefits of exercise. To resolve ties between solutions with
equal costs, management suggests prioritizing elevator stops at the lowest floor
possible, as this consumes less electricity. Importantly, the elevator is not
obligated to stop precisely at the floors specified by riders; for instance, if riders
indicate floors 27 and 29, the elevator can choose to stop at floor 28 instead. Your
task is to optimize the elevator's stops to minimize the total walking distance for
the riders.

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 Databases Questions!