{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Data Str &amp; Algorithm HW Solutions 55

# Data Str &amp; Algorithm HW Solutions 55 - (once the...

This preview shows page 1. Sign up to view the full content.

55 Latency and read time together require 3 . 5 8 . 33 ms. Thus, the time to read the fi rst track is about 88 ms. The time to read the next three tracks is 3 + 2100 / 3 0 . 08 + 3 . 5 8 . 33 32 . 2 ms. The last track takes just as long to read since it requires three rotations to read the 4 blocks. Thus, the total time required is 88 + 32 . 2 4 = 216 . 8 ms. 8.5 (a) Since a track holds 128Kb, the fi le requires 80 contiguous tracks. The interleave factor is three; rotational delay is one-half rotation; and the time to do one rotation at 5400 rpm is 11.11 ms. Thus, the time to read a track (once we have done the seek) is 3 . 5 11 . 11 33 . 9 ms. Since the random seek time is de fi ned to be 9.5 ms., the track-to-track seek time is de fi ned to be 2.2 ms., and the tracks are all adjacent, the total time required is 9 . 5 + 33 . 9 + 79(2 . 2 + 33 . 9) 2895 . 3 ms. (b) The fi le now requires 2560 clusters, and each cluster requires a random seek. Since the interleave factor is 3, the angular spread for a cluster is 22 sectors. Since a track holds 256 sectors, the time to read a cluster
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (once the seek has been performed is the rotational delay (one half of a rotation) plus 22 / 256 of a rotation. Thus, the total cost is 2560(9 . 5 + 11 . 11(0 . 5 + 22 / 256)) ≈ 40 , 985 ms. This is far more expensive than storing the f le in adjacent tracks. 8.6 Considering all of the possible cases for a disk with n tracks, the f rst track could be at any position from 1 to n , and the second track could be at any position from 1 to n . If the f rst track is i and the second is j , then the distance is | j − i | . Alternatively, in n of the n 2 possible cases the distance is 0, and otherwise we can count only the cases where i < j and multiply the sum by two to account for the cases where j < i . Thus, we get the average cost as 2 ∑ n i =1 ∑ n j = i +1 ( j − i ) n 2 = 2 ∑ n − 1 i =1 ∑ i j =1 ( j ) n 2 = 2 ∑ n − 1 i =1 ( i 2 + i ) / 2 n 2 = 1 n 2 ( n − 1 X i =1 i 2 + i ) =...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online