Data Str &amp; Algorithm HW Solutions 54

# Data Str &amp; Algorithm HW Solutions 54 - exercise as...

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

8 File Processing and External Sorting 8.1 Clearly the prices continue to change. But, the principles remain the same. 8.2 The f rst question is How many tracks are required by the f le? A track holds 144 . 5 K =72 K . Thus, the f le requires 5 tracks. The time to read a track is seek time to the track + latency time + (interleaf factor × rotation time). Average seek time is de f ned to be 80 ms. Latency time is 0 . 5 16 . 7 ms, and track rotation time is 16.7 ms for a total time to read the f rst track of 80 + 4 . 5 16 . 7 155 ms . Seek time for the remaining four tracks is de f ned to be 20 ms (since they are adjacent), with identical latency and read times. Thus, the total f le read time is 155 + 4(20 + 4 . 5 16 . 7) 536 ms which is pretty slow by today’s standards. 8.3 The expected time to read one track at random was given in the previous
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: exercise as 80 + 4 . 5 ∗ 16 . 7 = 155 ms. The expected time to read one sector at random is seek time plus latency plus the time to read one sector (which takes up 1 / 144 of a track). Thus, the time required is 80 + . 5 ∗ 16 . 7 + 1 / 144 ∗ 16 . 7 ≈ 88 . 5 ms. To read one byte, we save the sector read time of 1 / 144 ∗ 16 . 7 which is about .1 ms., which is insigni f cant. 8.4 This is quite similar to Exercise 8.2, but with more modern equipment. One track holds 31.5K bytes, so the f le requires 4 tracks plus 4 sectors of a f fth track. Seek time to the f rst track is 3 ms + 2100 / 3 ∗ . 08 ms ≈ 59 ms . 54...
View Full Document

## This note was uploaded on 12/27/2011 for the course MAP 2302 taught by Professor Bell,d during the Fall '08 term at UNF.

Ask a homework question - tutors are online