Problem:
Someone deleted the code that tells the elevator which floor to visit next. Write an algorithm to decide where the elevator will go. Calls arrive randomly for randomly selected floors 1-10 appended to the end of the callList.
Bad Answer: go to the floors starting from the first on the call list to the last.
Better (bad) Answer: go to the floors in order of nearest to furthest.
Better (ok) Answer: Just go up and down stopping as you pass each called floor
What’s your answer?