CSE Roadmap

Core tier · about 4 hours · 6 parts

Part 1 of 6 · 1 min read

Why this page comes fourth in Level 7

In this module you will

  • Turn a loose elevator question into numbered requirements.
  • Model one car with a direction, a door and a sorted set of stops.
  • Explain the sweep rule: keep going one way, serve stops on the path, then turn.
  • Choose a car for a hall call with a replaceable dispatcher.
  • Name the edge cases: same floor, bad floor, idle car, and a call behind a moving car.

The elevator question looks like a pile of buttons. It is really a scheduling question with a state machine inside it. This page uses the state idea of Level 4, module 3, the strategy idea of Level 4, module 1, and the five steps of Level 0, module 4. No book was supplied for this track, so the content is common practice, not from the books. The Java code was compiled and run before it was written here. Numbers marked "made up" only show the idea.