The Gateway to Computer Science Excellence
+1 vote
3.3k 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
in Others by Veteran (105k points) | 3.3k views
+1

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 ??

+1
+1
@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??

4 Answers

+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)
by Boss (49.3k points)
0
thank you sir.. in exam I also got 151 by adding those. hope will get marks as all options are wrong..
+1 vote

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

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

by Active (3.8k points)
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
by (111 points)
edited by
+1
Is this your voting, I've given the correct answer and yet getting a negative vote :)
0
I think you are mixing SCAN and C-SCAN
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 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
by (31 points)
Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,322 answers
198,402 comments
105,158 users