AnsPrac7db05 - Page 1 24/12/2009 CP5520 Answer to Practice...

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

View Full Document Right Arrow Icon
Page 1 24/12/2009 CP5520 Answer to Practice Week 7 15.14 A file of 4096 blocks is to be sorted with an available buffer space of 64 blocks. How many passes will be needed in the merge phase of the external sort-merge algorithm? Answer: We first need to compute the number of runs, N R , in the merge phase. Using the formula in the text, we have N R =  b / N b     Where b = 4096 (the number of blocks in the file), and N b = 64 (available buffer space) So, N R = 4096 / 64   = 64   --number of sorted runs In the merge phase, the number of passes is dependent on the degree of merging, D M , where DM = Min (N R , N b – 1) = Min (64, 64 –1) = 63 Hence, the number of passes is given by  Log  DM  (NR)   =   Log 63  (64)   = 2 15.15 Develop (approximate) cost functions for the 1) PROJECT, 2) UNION, INTERSECTION, SET DIFFERENCE, and 3) CARTESIAN PRODUCT algorithms discussed in section 15.4. Answer:
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 note was uploaded on 12/23/2009 for the course DBST 663 taught by Professor Tba during the Spring '09 term at MD University College.

Page1 / 2

AnsPrac7db05 - Page 1 24/12/2009 CP5520 Answer to Practice...

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