Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Suppose that a disk drive has 5,000 cylinders, numbered 0 to 4,999. The drive is

ID: 3702597 • Letter: S

Question

Suppose that a disk drive has 5,000 cylinders, numbered 0 to 4,999. The drive is currently serving a request at cylinder 2,150, and the previous request was at cylinder 1,805. The queue of pending requests, in FIFO order is as below:

2069, 1212, 2296, 2800, 544, 1618, 356, 1523, 4965, 3681

Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests for each of the following disk-scheduling algorithms?

a) LOOK   

b) C-LOOK

Explanation / Answer

1) LOOK

Starts the head movement in one direction. Satisfy the request for the closest track in that direction when there is no more request in the direction, the head is travelling in reverse direction, and repeat.

Now, since head has started from 1805 and is currently serving 2150, it is moving in the increasing direction. So, first it will fulfil all the requests that are step by step at a number higher than 2150.
So: 2150 -> 2296 -> 2800 -> 3681 -> 4965

After completing all the requests in this direction, the head will change the direction and serve the nearest pending request and move in the opposite direction, which here is:
4965 -> 2069 -> 1618 -> 1523 -> 1212 -> 544 -> 356

Hence the total distance wil be: distrance from 2150 to 4965 + distance from 4965 to 356
Which is:
Total Distance= |2150-4965| + |4965 - 356| = 7424 cylinders

2) C-LOOK

C-LOOK is the circular variant of the LOOK algorithm.
Meaning, the jumps are reachable from two extreme ends also. i.e here we can jump from the highest numbered request, i.e 4965 directly to the lowest numbered request, i.e 356.

Like in the previous algorithm, since head has started from 1805 and is currently serving 2150, it is moving in the increasing direction. So, first it will fulfil all the requests that are step by step at a number higher than 2150.
So: 2150 -> 2296 -> 2800 -> 3681 -> 4965

Now, since this is a circular algorithm, arm will jump from 4965 -> 356.

Then, it will go from 356 in the same direction, till all the remaining requests are fulfilled
So, 356 -> 544 -> 1212 -> 1523 -> 1618 -> 2069

Hence the total distance wil be: distrance from 2150 to 4965 + distance from 4965 to 356 + distance from 356 to 2069
Which is:
Total Distance = |2150-4965| + |4965 - 356| + |356 - 2069| = 9137 cylinders

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote