Mark Yourself Question
Assume n = 64 items and that a merge-sort recursion has one level of total combining work equal to 64 comparison units at every non-base level. How many comparison units are accumulated across the six non-base levels? Explain why the work is 64 per level rather than 64 for each sublist.
Unlock full course notes by signing up
Divide and Conquer Algorithms: difficulty 4
A programmer proposes (a) searching an unsorted log with binary search, (b) sorting two separately collected numeric lists and then merging them, and (c) finding the maximum of a nonempty list by returning its element if it is a singleton; otherwise splitting it into two nonempty halves as equal in size as possible, recursively finding each half's maximum, and returning the larger subanswer. For each proposal, state whether the described divide-and-conquer idea is valid as written and give the key reason or missing precondition.