1,877 views

Consider a disk queue with I/O requests on the following cylinders in their arriving order: $6,10,12,54,97,73,128,15,44,110,34,45$. The disk head is assumed to be at cylinder $23$ and moving in the direction of decreasing number of cylinders. Total number of cylinders  in the disk is $150$. The disk head movement using  SCAN –scheduling algorithm is:

1. $172$
2. $173$
3. $227$
4. $228$

Question says, total number of cylinders in the disk = 150.

Let's say - 1 to 150

Now initially it is serving at = 23.

So, total head movement= [23 to 1] +[ 1 to 128]

= 22 + 127 = 149 ??

If it starts from 0 to 149 ,

So, total head movement= [23 to 0] +[ 0 to 128]

= 23 + 128 = 151 ??

@vijaycs If nothing is given(and suppose we have to fill in numerical) by default we have to take from 0 to 149. Isn't it??
ans : 151 . not mentionedin any option .

All options incorrect ans should be  = 151

disk head initailly at 23  and direction is towards 0

first arrange in sorted order  and use SCAN method

6   `10   12   15            34    44     45    54    73    97   110   128

now  from 23 to 15 then 15 to 12 and 12 to 10  and 10 to 6 then 6 to 0 then 0 to 34 34 to 44 and so on finally stops at 128

total head movements = 8+3+2+4+6+34+10+1+9+19+24+13+18 =151       it will not go to 150 (bounadary so can not be option B 173)

### 1 comment

thank you sir.. in exam I also got 151 by adding those. hope will get marks as all options are wrong..

ans is 151.. so no option is correct. explanation given in

https://gateoverflow.in/111994/ugc-net-2017-paper-3-q-50

As we know the SCAN Scheduling Algorithm is also know as Elevator algorithm, it scans from the one end to another end.

In this case head starts from 23 onwards 1 (in the direction of decreasing number of cylinders) and then moves to the another end i.e., 150 (Total number of cylinders in the disk is 150)

Hence total head movement = 23 to 1 + 1 to 150
= 23 + 150
= 173 (Option B)

by

Is this your voting, I've given the correct answer and yet getting a negative vote :)
I think you are mixing SCAN and C-SCAN
What I mean is that after reaching 1 it will go to another end servicing the middle cylinders on the way.

C-SCAN simply means going to another end without servicing middle requests.

Cylinders are: 6, 10, 12, 54, 97, 73, 128, 15, 44, 110, 34, 45

In Asc Order: 6, 10, 12, 15, 34, 44, 45, 54, 73, 97, 110, 128

So when we are using SCAN (and the direction of moving is in decreasing number of cylinders) then the head will move 23 (initial position) to 1 and attend 15, 12, 10, 6 on its way. Then it will move from this end to another end servicing the requests in 34, 44, 45, 54, 73, 97, 110, 128 order till end i.e., to 150. Hence total movement will be 23 to 1 + 1 to 150. Hence the answer.
It should be 151 after calculation

But i think they are considering the last also from 128 to 150 due to the SCAN algorithm will go to the end

So, 151+ (150-128)=173