0 votes 0 votes shruti gupta1 asked Apr 25, 2018 shruti gupta1 814 views answer comment Share Follow See all 14 Comments See all 14 14 Comments reply Devshree Dubey commented Apr 25, 2018 reply Follow Share @shruti gupta1,Please may I know what is the starting position at which the disk head is positioned? 0 votes 0 votes shruti gupta1 commented Apr 26, 2018 reply Follow Share I also didn't get it sir.either the question is missing something or me. 0 votes 0 votes Devshree Dubey commented Apr 26, 2018 reply Follow Share @shruti gupta1,Please don't mind,but I'll advise you to please recheck your question. Coz you see a starting position should be mentioned. Don't u think?Just think for urself for a few minutes. For better understanding on Elevator on SCAN algorithm refer Galvin,the standard texbook. If u don't have the excerpt I'll share a snapshot of it. Do tell. Yeah. :) 0 votes 0 votes gauravkc commented Apr 26, 2018 reply Follow Share 130 ? 0 votes 0 votes Devshree Dubey commented Apr 26, 2018 reply Follow Share @gauravkc,Can u please share ur method? 0 votes 0 votes shruti gupta1 commented Apr 26, 2018 reply Follow Share please share it 0 votes 0 votes gauravkc commented Apr 26, 2018 reply Follow Share In SCAN and LOOK, initial direction matters most. Now, I accidentally calculated 130 by LOOK algorithm. Servicing 62 has been done and currently servicing 80 which means head is moving from 0 to towards 191. Once you know the direction, SCAN goes in that direction but till the end i.e 191 (I mistook it as it goes to last track to be serviced which is actually LOOK algorithm (going till 119)) If calculated by SCAN, the answer must be 274 and if calculated by LOOK answer is 130 0 votes 0 votes Devshree Dubey commented Apr 26, 2018 reply Follow Share @gauravkc,Which is the starting position of the head?Also, please share ur method for more detailed explanation. It'll be helpful indeed. 0 votes 0 votes gauravkc commented Apr 26, 2018 reply Follow Share Starting position is 80 as it is currently serving 80. SCAN says.. keep on servicing requests till you reach the end of the disk. If you reach the end of the disk just reverse your direction and move to opposite direction and while moving, service the requests. To do this, you should know the initial direction. For that purpose, the previously serviced track is given as 62. Note that if it wasn't given, we would have assumed initial direction towards minimum distance request from the current position. (i.e. towards 0 as from 80 nearest is 75). But since it's given it moved from 62 to 80, we now know it is moving towards 191. So the head would move like 80-103-111-114-119-191-75-58-55-30-28 which when calculated turns out to be 274 0 votes 0 votes gauravkc commented Apr 26, 2018 reply Follow Share Look won't go till end. It would go till last request to be serviced. Everything else same as scan. Hence head would move as 80-103-111-114-119-75-58-55-30-28 which when calculated turns out to be 130. (I mistook this as scan and commented 130) 0 votes 0 votes Devshree Dubey commented Apr 26, 2018 reply Follow Share @gauravkc,Another name of SCAN algorithm is Elevator algorithm brother. You've to work out the solution using SCAN algo only. Sorry for causing the troubles. But please rework ur solution. And share the ans using SCAN algo. 0 votes 0 votes gauravkc commented Apr 26, 2018 reply Follow Share Yes. I'm saying, I got 130 by look algo (By mistake confused between scan and look). Using scan I'm getting 274 0 votes 0 votes Devshree Dubey commented Apr 26, 2018 reply Follow Share @gauravkc,Brother if u don't mind can you please share ur method of SCAN?Indeed a big help. 0 votes 0 votes gauravkc commented Apr 27, 2018 reply Follow Share This is using SCAN algo. I'm getting 274. And by using LOOK algo, I got 130 1 votes 1 votes Please log in or register to add a comment.