80 likes | 305 Views
Introduction. Merge Sort (Analysis ). Design and Analysis of Algorithms I. Running Time of Merge Sort. Claim: For every input array of numbers, Merge Sort produces a sorted output array and uses operations. Proof of claim (assuming n = power of 2):.
E N D
Introduction Merge Sort (Analysis) Design and Analysis of Algorithms I
Running Time of Merge Sort Claim: For every input array of numbers, Merge Sort produces a sorted output array and uses operations.
Roughly how many levels does this recursion tree have (as a function of n, the length of the input array)? A constant number (independent of n).
What is the pattern? Fill in the blanks in the following statement: at each level j=0,1,2,…,, there are <blank>subproblems, each of size <blank>. 2jand 2j, respectively.
Proof of claim (assuming n = power of 2): At each level j=0,1,2,…, , there are 2jsubproblems, each of size n/2j.
Running Time of Merge Sort Claim: For every input array of numbers, Merge Sort produces a sorted output array and uses operations.