Data Structures & Alogs HW_Part_15

Data Structures & Alogs HW_Part_15 - 57 (b) Cutting the...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
57 (b) Cutting the disk I/O time will substantially improve the external sorting time. A reasonable estimate is that cutting disk I/O time in half will cut the sorting time by around 1/3. (c) Main memory access time will not help a great deal, since disk I/O is the probable bottleneck. However, for the sorting operation, main memory access time is in fact more of a bottleneck than CPU speed, so it should help more to speed the memory than to speed the CPU. (d) Increasing the memory size by a factor of two will increase the f le size that can be processed by a single pass of multi-way merge by a factor of four, in two passes by a factor of eight, and so no. If this leads to a reduction in the number of passes need to process the f le, then a substantial time savings will be realized. This could easily cut the processing time by 1/3 or 1/4 since 2 or 3 passes of multiway merge under the initial conditions are reasonable to expect. 8.14 How to approach this depends on the form of the records. If they have rela- tively small, f xed-length keys, the best solution would be to make a simple linear index f le, as discussed in Chapter 11. Simply make a pass through the original record f le and store in the index f le for each record the key and a pointer to the original record. Then, sort the index f le. If the records to be sorted have a large, variable length key, the index f le approach will not work. In this case, it is possible to sort the f le directly. We must modify both replacement selection and multiway merge. For replace-
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 10/31/2011 for the course BCN 3431 at University of Florida.

Page1 / 4

Data Structures & Alogs HW_Part_15 - 57 (b) Cutting the...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online