in Operating System recategorized
1,647 views
1 vote
1 vote

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$
in Operating System recategorized
1.6k views

4 Comments

@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??
1
1
0
0
ans : 151 . not mentionedin any option .
0
0

6 Answers

5 votes
5 votes
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..
0
0
1 vote
1 vote

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

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

0 votes
0 votes
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)

Answer: B
edited by

3 Comments

Is this your voting, I've given the correct answer and yet getting a negative vote :)
1
1
I think you are mixing SCAN and C-SCAN
0
0
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.
0
0
0 votes
0 votes
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
Answer:

Related questions