Bird
0
0

In the LOOK disk scheduling algorithm, if the head starts at position 30 and the requests are at [5, 15, 25, 35, 45, 55], what is the order of servicing requests if the head moves towards lower track numbers first?

medium📝 Analysis Q5 of 15
LLD - Design — Elevator System
In the LOOK disk scheduling algorithm, if the head starts at position 30 and the requests are at [5, 15, 25, 35, 45, 55], what is the order of servicing requests if the head moves towards lower track numbers first?
A[30, 35, 45, 55, 25, 15, 5]
B[30, 25, 15, 5, 35, 45, 55]
C[30, 5, 15, 25, 35, 45, 55]
D[30, 15, 25, 5, 35, 45, 55]
Step-by-Step Solution
Solution:
  1. Step 1: Determine head movement direction

    The head starts at 30 and moves towards lower track numbers first.
  2. Step 2: Service requests less than 30 in descending order

    Requests less than 30 are 25, 15, and 5, serviced in order: 25, 15, 5.
  3. Step 3: Reverse direction and service remaining requests

    After reaching the lowest request (5), the head reverses and services requests greater than 30 in ascending order: 35, 45, 55.
  4. Final Answer:

    [30, 25, 15, 5, 35, 45, 55] -> Option B
  5. Quick Check:

    Head moves down first, then up servicing requests accordingly [OK]
Quick Trick: LOOK moves only as far as last request in direction [OK]
Common Mistakes:
MISTAKES
  • Servicing requests out of head movement order
  • Assuming head moves to disk end regardless of requests
  • Not reversing direction after last request

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes