CS计算机代考程序代写 algorithm Disk Queuing Problem

Disk Queuing Problem
Assumptions: To simplify things, we will suppose that the disk has only one platter with tracks on a single side, and that requests are given by track number [which is equal to cylinder number] (thus, we will ignore rotational latency, which can be approximated with the average value, but we will not consider this).

Suppose the disk platter has 200 tracks, numbered from 0 to 199; track 0 is closest to the edge of the platter, and track 199 is closest to the center.
Current head position: track 86, and the head is moving toward track 199.

Disk Queue (front to back, in order of arrival of requests):
33, 19, 62, 81, 176, 47, 106, 121
Give the order in which tracks are accessed/visited by the disk head, and calculate the total head movement, for each of the following algorithms:
1) FCFS
(a) Order requests are served: 33, 19, 62, 81, 176, 47, 106, 121
(b)Total head movement (in tracks):
(86 – 33) + (33 – 19) + (62 – 19) + (81 – 62) + (176 – 81) + (176 – 47) +
(106 – 47) + (121 – 106) = 53 + 14 + 43 + 19 + 95 + 129 + 59 + 15
= 427
2) SSTF
(a)Order requests are served: 86, 81, 62, 47, 33, 19, 106, 121, 176
(b)Total head movement (in tracks):

3) SCAN
(a)Order requests are served: 86, 106, 121, 176, 199, 81, 62, 47, 33, 19
(b)Total head movement (in tracks):

4) C-SCAN
(a)Order requests are served: 86, 106, 121, 176, 199, 0, 19, 33, 47, 62, 81
(b)Total head movement (in tracks):

5) LOOK
(a)Order requests are served: 86, 106, 121, 176, 81, 62, 47, 33, 19
(b)Total head movement (in tracks):

6) C-LOOK
(a)Order requests are served: 86, 106, 121, 176, 19, 33, 47, 62, 81

(b)Total head movement (in tracks):