{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Data Structures &amp; Alogs HW_Part_14

# Data Structures &amp; Alogs HW_Part_14 - 53 7.19 There...

This preview shows pages 1–3. Sign up to view the full content.

53 7.19 There are n possible choices for the position of a given element in the array. Any search algorithm based on comparisons can be modeled using a decision tree. The tree must have at least n leaf nodes, one for each of the possible choices for solution. A tree with n leaves must have depth at least log n . Thus, any search algorithm based on comparisons requires at least log n work in the worst case.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
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 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
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

Data Structures &amp; Alogs HW_Part_14 - 53 7.19 There...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online