94 votes 94 votes The head of a hard disk serves requests following the shortest seek time first (SSTF) policy. What is the maximum cardinality of the request set, so that the head changes its direction after servicing every request if the total number of tracks are $2048$ and the head can start from any track? $9$ $10$ $11$ $12$ Operating System gateit-2007 operating-system disk-scheduling normal + – Ishrat Jahan asked Oct 30, 2014 edited Jun 19, 2018 by kenzou Ishrat Jahan 22.8k views answer comment Share Follow See all 17 Comments See all 17 17 Comments reply Show 14 previous comments shashankrustagi commented Jan 19, 2021 reply Follow Share yes ABHINEET, it will be independent. You can start with any track, do zig zag, you will erach 2047 in 11 steps only. 0 votes 0 votes tusharSingh commented Jan 30, 2021 i edited by tusharSingh Jan 30, 2021 reply Follow Share @Aalok8523 @Skscool007 Initially head will be at some position or moving in some specific direction then we should not take current position of head in cardinality of the request because if we do so then head will not change it's direction if request come at track on which it is currently there. So that's why you are getting 12. Because of above reason you should remove one track (initial position of head) and answer should be 11. I hope it will help others who are confused in the battle of 11 and 12. 1 votes 1 votes samir757 commented Jan 11, 2022 reply Follow Share good question (0+1) + (1+2) + (3+4) + (7+8) + (15+16) + ( 31+32) + (63+64) + (127+128) + (255+256) + (511+512) + (1023+1024) Hence 11 will be the answer. 1 votes 1 votes Please log in or register to add a comment.
3 votes 3 votes correct answer C ayush.5 answered Aug 31, 2019 ayush.5 comment Share Follow See all 0 reply Please log in or register to add a comment.
2 votes 2 votes We can start from any track. $1366\overset{-1}{\rightarrow}1365\overset{+(1+2)}{\rightarrow}1368\overset{-(3+4)}{\rightarrow}1361\overset{+(7+8)}{\rightarrow}1376\overset{-(15+16)}{\rightarrow}1345\overset{+(31+32)}{\rightarrow}$$1408\overset{-(63+64)}{\rightarrow}1281\overset{+(127+128)}{\rightarrow}1536\overset{-(255+256)}{\rightarrow}1025\overset{+(511+512)}{\rightarrow}2048\overset{-(1023+1024)}{\rightarrow}1$ $-$ indicates we are going in left direction $+$ indicates we are going in right direction. $new\ distance = previous\ distance +( previous\ distance + 1)$ $+1$ is used to remove ambiguity when choosing next track. Hence Option $D. \ 12 $ is correct answer. Satbir answered Dec 16, 2019 edited Dec 16, 2019 by Satbir Satbir comment Share Follow See all 9 Comments See all 9 9 Comments reply Show 6 previous comments Satbir commented Dec 16, 2019 reply Follow Share @Arjun Sir, please read the 2nd comment. Why we are not counting the first one ? I have considered $1366$ also as a request. Please explain. 0 votes 0 votes Shaik Masthan commented Dec 16, 2019 reply Follow Share Let We are at some track, can't we have request to same track again? If yes, then we have to count the initial one too... After servicing this request, head move to either left or right which is indirectly meaning, head changes it's direction. 0 votes 0 votes Arjun commented Dec 17, 2019 reply Follow Share We can have request to same track but then the head won't change its direction and this violate the condition given in question. 8 votes 8 votes Please log in or register to add a comment.
2 votes 2 votes video explanation .………………… https://youtu.be/aEytXqw7_sI?t=688 Nitesh_Yadav answered Apr 9, 2022 Nitesh_Yadav comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes Answer: B Let the head start from 1024. Requests are: 344, 854, 982, 1014, 1022, 1025, 1028, 1045, 1109, 1364 Cardinality: 10 Rajarshi Sarkar answered Apr 13, 2015 Rajarshi Sarkar comment Share Follow See all 2 Comments See all 2 2 Comments reply Vaibhav Raj Singh commented Dec 16, 2016 reply Follow Share 1024 itself can be included in the set right? Then we start at 1024, first serve request for 1024 and then move to 1025 and so on. That will make the cardinality 11. 1 votes 1 votes Xylene commented Jun 27, 2017 reply Follow Share 1024 should not be included in the set. Even in the first part of the question, 180th track which was the head was not included in the request set. @Vaibhav 0 votes 0 votes Please log in or register to add a comment.