Lecture 5 - Problems
- Analyze the runtime of merge sort if, for some reason, you split the
array 1/3 left and 2/3 right.
- Analyze the runtime of merge sort if, for some reason, you split the
array such that only two elements are in the left “half”, and all
remaining elements are in the right.
- In which divide-and-conquer phase (divide, conquer, combine) is all
the “real work” of mergesort performed for merge sort? In other words,
in which phase do the values end up actually being rearranged?
- Derive an expression for the number of calls to
mergeSort
that result from an initial call with array size
\(2^k\).