‹ BackHN Continuity

Thread

Show HN: Elevators

1668 points · 413 comments · Jrh0203

  1. peterldowns · · focus · HN ↗
    Back in highschool, simulating different elevator algorithms was one of the projects I implemented during my CS class. It wasn't for the class — AP CS did not require anything like actual programming — but it was a fun project.

    A cool connection is that a spinning-disk hard drive (HDD) is actually kind of like one really long elevator, just wrapped around a spindle instead of perfectly vertical. The SCAN algorithm is actually a disk-scheduling algorithm!

    <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Elevator_algorithm" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Elevator_algorithm

    1. amenghra · · focus · HN ↗
      It&#x27;s fun that the same algorithm applies to two different problems. In the disk case, the only unpredictable thing is future requests. Elevators have to deal with two unpredictable things, future requests as well as how long humans take to get in and out of the elevator. So it&#x27;s doubly fun that the same algorithm works in both cases!
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.