lec062 - Improve Run Generation Overlap input,output, and...

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

View Full Document Right Arrow Icon
Improve Run Generation Overlap input,output, and internal CPU work. Reduce the number of runs (equivalently, increase average run length). DISK MEMORY DISK Internal Quick Sort 6 2 8 5 11 10 4 1 9 7 3 Use 6 as the pivot (median of 3). Input first, middle, and last blocks first. In-place partitioning. Input blocks from the ends toward the middle. Sort left and right groups recursively. Can begin output as soon as left most block is ready. 4 2 3 5 1 6 10 11 9 7 8
Background image of page 1

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

View Full DocumentRight Arrow Icon
Alternative Internal Sort Scheme DISK DISK B1 B2 B3 Partition into 3 areas, each may be more than 1 block in size. Steady State Operation Read from disk Write to disk Run generation Synchronization is done when the current input area gets full (the current output area will be empty at this time).
Background image of page 2
MEMORY DISK New Strategy Use 2 input and 2 output buffers. Rest of memory is used for a min loser tree. Input 1 Input 0 Output 0 Output 1 Loser Tree Steady State Operation Read from disk Write to disk Run generation
Background image of page 3

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

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

Page1 / 15

lec062 - Improve Run Generation Overlap input,output, and...

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

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