Bird
0
0

What is the total head movement if the head moves towards lower track numbers first?

hard📝 Trade-off Q15 of 15
LLD - Design — Elevator System
You have a disk with size 200 tracks and requests at [10, 50, 120, 180]. The head is at 100 and moves using LOOK algorithm. What is the total head movement if the head moves towards lower track numbers first?
A260 tracks
B160 tracks
C180 tracks
D120 tracks
Step-by-Step Solution
Solution:
  1. Step 1: Initial direction to lower tracks

    Lower requests: 50, 10. Path: 100 -> 50 (50 tracks), 50 -> 10 (40 tracks). Subtotal: 90.
  2. Step 2: Reverse direction to higher tracks

    Higher requests: 120, 180. Path: 10 -> 120 (110 tracks), 120 -> 180 (60 tracks). Subtotal: 170.
  3. Step 3: Total head movement

    90 + 170 = 260 tracks.
  4. Final Answer:

    260 tracks -> Option A
  5. Quick Check:

    Sum of |current - next| over servicing sequence [OK]
Quick Trick: Sum distances in servicing order: 100-50-10-120-180 [OK]
Common Mistakes:
MISTAKES
  • Including disk edges in LOOK movement
  • Adding extra distances beyond last requests
  • Misordering request servicing

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes