Mergesort (recursive)

Hide text Hide pseudo-code

Apply recursive mergesort to the following Input array. Hint: Draw a Call Tree for the recursive algorithm (see Insructions).

Some additional problems.

MERGESORT(array Input; int left; int right)
1 if (left < right)
2   int mid = (right + left) / 2
3   MERGESORT(Input, left, mid)
4   MERGESORT(Input, mid+1, right)
5   Merge Input[left..mid] and Input[mid+1..right] into Auxiliary Table
6   Move Auxiliary Table to Input[left..right]


  Created Fri Oct 30 13:52:50 EET 2009 - Powered by SVG-hut