Hỏi tổng số bước di chuyển đầu đọc của thuật toán Shortest-Seek-Time First (SSTF)
Trả lời:
Đáp án đúng: A
The Shortest Seek Time First (SSTF) algorithm selects the request with the minimum seek time from the current head position. To calculate the total head movement, we need to determine the order in which requests are served and the distances between them.
Given the current head position at 50 and requests at 82, 170, 43, 140, 24, 16, and 190, we proceed as follows:
1. **Initialization:** Current position = 50.
2. **Step 1:** Distances from 50 to each request:
- |50-82| = 32
- |50-170| = 120
- |50-43| = 7
- |50-140| = 90
- |50-24| = 26
- |50-16| = 34
- |50-190| = 140
The nearest request is 43. Move to 43. Steps = 7.
3. **Step 2:** Current position = 43. Distances from 43 to remaining requests:
- |43-82| = 39
- |43-170| = 127
- |43-140| = 97
- |43-24| = 19
- |43-16| = 27
- |43-190| = 147
The nearest request is 24. Move to 24. Steps = 19.
4. **Step 3:** Current position = 24. Distances from 24 to remaining requests:
- |24-82| = 58
- |24-170| = 146
- |24-140| = 116
- |24-16| = 8
- |24-190| = 166
The nearest request is 16. Move to 16. Steps = 8.
5. **Step 4:** Current position = 16. Distances from 16 to remaining requests:
- |16-82| = 66
- |16-170| = 154
- |16-140| = 124
- |16-190| = 174
The nearest request is 82. Move to 82. Steps = 66.
6. **Step 5:** Current position = 82. Distances from 82 to remaining requests:
- |82-170| = 88
- |82-140| = 58
- |82-190| = 108
The nearest request is 140. Move to 140. Steps = 58.
7. **Step 6:** Current position = 140. Distances from 140 to remaining requests:
- |140-170| = 30
- |140-190| = 50
The nearest request is 170. Move to 170. Steps = 30.
8. **Step 7:** Current position = 170. The distance from 170 to 190 is 20. Move to 190. Steps = 20.
Total steps = 7 + 19 + 8 + 66 + 58 + 30 + 20 = 208
Since none of the provided options match the calculated result (208 cylinders), there might be an error in the question or the answer choices. However, based on the SSTF algorithm, we have calculated the head movement as accurately as possible.
In this case, there is no correct answer among the options.
50 câu hỏi 60 phút





