GATE Exam  >  GATE Questions  >   A disk has 200 tracks(from 0 to 199). At tim... Start Learning for Free
A disk has 200 tracks(from 0 to 199). At time t = 0, the pending requests for read are for the following disks in the order:
46, 110, 32, 52, 14, 120, 36, 96.
Current head position is at 50 and moving towards 0.
If the SSTF algorithm and SCAN algorithm are used, difference in total movement of tracks is
  • a)
    10
  • b)
    20
  • c)
    12
  • d)
    22
Correct answer is option 'B'. Can you explain this answer?
Verified Answer
A disk has 200 tracks(from 0 to 199). At time t = 0, the pending requ...
In case of SSTF algorithm, the requests are served in this order
52, 46, 36, 32, 14, 96, 110, 120⇒Total track movements = 146
In case of SCAN, the requests are served in the order: 46, 36, 32, 14, 52, 96, 110, 120
Total track movements = (46-36)+(36-32)+(32-14)+(14-0)+(52-0)+(96-52)+(110-96)+(120-110) = 170.
Hence extra movement =20.
View all questions of this test
Most Upvoted Answer
A disk has 200 tracks(from 0 to 199). At time t = 0, the pending requ...
Problem:
A disk has 200 tracks (from 0 to 199). At time t = 0, the pending requests for read are for the following disks in the order: 46, 110, 32, 52, 14, 120, 36, 96. Current head position is at 50 and moving towards 0. If the SSTF algorithm and SCAN algorithm are used, the difference in total movement of tracks is

Approach:
To solve this problem, we will calculate the total movement of tracks using the SSTF (Shortest Seek Time First) and SCAN algorithms and then find the difference between the two.

SSTF Algorithm:
1. Initialize the total_movement variable to 0.
2. Sort the pending requests according to their distance from the current head position.
3. Find the request with the shortest seek time from the current head position.
4. Move the head to that request and add the seek time to the total_movement.
5. Remove the processed request from the pending requests.
6. Repeat steps 3-5 until all requests are processed.
7. Return the total_movement.

SCAN Algorithm:
1. Initialize the total_movement variable to 0.
2. Sort the pending requests in ascending order.
3. Find the request with the nearest track in the direction of the current head position.
4. Move the head to that request and add the seek time to the total_movement.
5. Remove the processed request from the pending requests.
6. If all requests in the current direction are processed, change the direction and move the head to the last track in that direction.
7. Repeat steps 3-6 until all requests are processed.
8. Return the total_movement.

Calculations:

SSTF Algorithm:
Total_movement = (50-46) + (110-46) + (120-110) + (120-96) + (96-52) + (52-36) + (36-32) + (32-14) = 4 + 64 + 10 + 24 + 44 + 16 + 4 + 18 = 184

SCAN Algorithm:
In the SCAN algorithm, the head moves towards the 0 track, so we need to find the nearest request in the direction of the head and then move towards the 0 track.

Total_movement = (52-50) + (46-0) + (110-46) + (120-110) + (120-96) + (96-36) + (32-14) + (36-32) = 2 + 46 + 64 + 10 + 24 + 60 + 18 + 4 = 228

Difference:
Difference = Total_movement(SCAN) - Total_movement(SSTF) = 228 - 184 = 44

Therefore, the difference in the total movement of tracks using the SSTF and SCAN algorithms is 44, which corresponds to option 'B'.
Explore Courses for GATE exam
A disk has 200 tracks(from 0 to 199). At time t = 0, the pending requests for read are for the following disks in the order:46, 110, 32, 52, 14, 120, 36, 96.Current head position is at 50 and moving towards 0.If the SSTF algorithm and SCAN algorithm are used, difference in total movement of tracks isa)10b)20c)12d)22Correct answer is option 'B'. Can you explain this answer?
Question Description
A disk has 200 tracks(from 0 to 199). At time t = 0, the pending requests for read are for the following disks in the order:46, 110, 32, 52, 14, 120, 36, 96.Current head position is at 50 and moving towards 0.If the SSTF algorithm and SCAN algorithm are used, difference in total movement of tracks isa)10b)20c)12d)22Correct answer is option 'B'. Can you explain this answer? for GATE 2024 is part of GATE preparation. The Question and answers have been prepared according to the GATE exam syllabus. Information about A disk has 200 tracks(from 0 to 199). At time t = 0, the pending requests for read are for the following disks in the order:46, 110, 32, 52, 14, 120, 36, 96.Current head position is at 50 and moving towards 0.If the SSTF algorithm and SCAN algorithm are used, difference in total movement of tracks isa)10b)20c)12d)22Correct answer is option 'B'. Can you explain this answer? covers all topics & solutions for GATE 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for A disk has 200 tracks(from 0 to 199). At time t = 0, the pending requests for read are for the following disks in the order:46, 110, 32, 52, 14, 120, 36, 96.Current head position is at 50 and moving towards 0.If the SSTF algorithm and SCAN algorithm are used, difference in total movement of tracks isa)10b)20c)12d)22Correct answer is option 'B'. Can you explain this answer?.
Solutions for A disk has 200 tracks(from 0 to 199). At time t = 0, the pending requests for read are for the following disks in the order:46, 110, 32, 52, 14, 120, 36, 96.Current head position is at 50 and moving towards 0.If the SSTF algorithm and SCAN algorithm are used, difference in total movement of tracks isa)10b)20c)12d)22Correct answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for GATE. Download more important topics, notes, lectures and mock test series for GATE Exam by signing up for free.
Here you can find the meaning of A disk has 200 tracks(from 0 to 199). At time t = 0, the pending requests for read are for the following disks in the order:46, 110, 32, 52, 14, 120, 36, 96.Current head position is at 50 and moving towards 0.If the SSTF algorithm and SCAN algorithm are used, difference in total movement of tracks isa)10b)20c)12d)22Correct answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of A disk has 200 tracks(from 0 to 199). At time t = 0, the pending requests for read are for the following disks in the order:46, 110, 32, 52, 14, 120, 36, 96.Current head position is at 50 and moving towards 0.If the SSTF algorithm and SCAN algorithm are used, difference in total movement of tracks isa)10b)20c)12d)22Correct answer is option 'B'. Can you explain this answer?, a detailed solution for A disk has 200 tracks(from 0 to 199). At time t = 0, the pending requests for read are for the following disks in the order:46, 110, 32, 52, 14, 120, 36, 96.Current head position is at 50 and moving towards 0.If the SSTF algorithm and SCAN algorithm are used, difference in total movement of tracks isa)10b)20c)12d)22Correct answer is option 'B'. Can you explain this answer? has been provided alongside types of A disk has 200 tracks(from 0 to 199). At time t = 0, the pending requests for read are for the following disks in the order:46, 110, 32, 52, 14, 120, 36, 96.Current head position is at 50 and moving towards 0.If the SSTF algorithm and SCAN algorithm are used, difference in total movement of tracks isa)10b)20c)12d)22Correct answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice A disk has 200 tracks(from 0 to 199). At time t = 0, the pending requests for read are for the following disks in the order:46, 110, 32, 52, 14, 120, 36, 96.Current head position is at 50 and moving towards 0.If the SSTF algorithm and SCAN algorithm are used, difference in total movement of tracks isa)10b)20c)12d)22Correct answer is option 'B'. Can you explain this answer? tests, examples and also practice GATE tests.
Explore Courses for GATE exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev