11.07.2015 Views

Data Structures and Algorithm Analysis - Computer Science at ...

Data Structures and Algorithm Analysis - Computer Science at ...

Data Structures and Algorithm Analysis - Computer Science at ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Sec. 8.7 Exercises 2978.9 Using the specific<strong>at</strong>ions for the disk drive given in Exercise 8.8, calcul<strong>at</strong>e theexpected time to read one entire track, one sector, <strong>and</strong> one byte. Show yourcalcul<strong>at</strong>ions.8.10 Using the disk drive specific<strong>at</strong>ions given in Exercise 8.8, calcul<strong>at</strong>e the timerequired to read a 10MB file assuming(a) The file is stored on a series of contiguous tracks, as few tracks as possible.(b) The file is spread r<strong>and</strong>omly across the disk in 8KB clusters.Show your calcul<strong>at</strong>ions.8.11 At the end of 2004, the fastest disk drive I could find specific<strong>at</strong>ions for wasthe Maxtor Atlas. This drive had a nominal capacity of 73.4GB using 4 pl<strong>at</strong>ters(8 surfaces) or 9.175GB/surface. Assume there are 16,384 tracks with anaverage of 1170 sectors/track <strong>and</strong> 512 bytes/sector. 4 The disk turns <strong>at</strong> 15,000rpm. The track-to-track seek time is 0.4 ms <strong>and</strong> the average seek time is 3.6ms. How long will it take on average to read a 6MB file, assuming th<strong>at</strong> thefirst track of the file is r<strong>and</strong>omly placed on the disk, th<strong>at</strong> the entire file lies oncontiguous tracks, <strong>and</strong> th<strong>at</strong> the file completely fills each track on which it isfound. Show your calcul<strong>at</strong>ions.8.12 Using the specific<strong>at</strong>ions for the disk drive given in Exercise 8.11, calcul<strong>at</strong>ethe expected time to read one entire track, one sector, <strong>and</strong> one byte. Showyour calcul<strong>at</strong>ions.8.13 Using the disk drive specific<strong>at</strong>ions given in Exercise 8.11, calcul<strong>at</strong>e the timerequired to read a 10MB file assuming(a) The file is stored on a series of contiguous tracks, as few tracks as possible.(b) The file is spread r<strong>and</strong>omly across the disk in 8KB clusters.Show your calcul<strong>at</strong>ions.8.14 Prove th<strong>at</strong> two tracks selected <strong>at</strong> r<strong>and</strong>om from a disk are separ<strong>at</strong>ed on averageby one third the number of tracks on the disk.8.15 Assume th<strong>at</strong> a file contains one million records sorted by key value. A queryto the file returns a single record containing the requested key value. Filesare stored on disk in sectors each containing 100 records. Assume th<strong>at</strong> theaverage time to read a sector selected <strong>at</strong> r<strong>and</strong>om is 10.0 ms. In contrast, ittakes only 2.0 ms to read the sector adjacent to the current position of the I/Ohead. The “b<strong>at</strong>ch” algorithm for processing queries is to first sort the queriesby order of appearance in the file, <strong>and</strong> then read the entire file sequentially,processing all queries in sequential order as the file is read. This algorithmimplies th<strong>at</strong> the queries must all be available before processing begins. The“interactive” algorithm is to process each query in order of its arrival, searchingfor the requested sector each time (unless by chance two queries in a row4 Again, this track layout does does not account for the zoned arrangement on modern disk drives.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!