{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

AnsPrac7db05

# AnsPrac7db05 - Page 1 CP5520 Answer to Practice Week 7...

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

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:

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

AnsPrac7db05 - Page 1 CP5520 Answer to Practice Week 7...

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

View Full Document
Ask a homework question - tutors are online