C++/Merge Sort Question
Expert: vijayan - 3/9/2010
QuestionImplement the mergesort algorithm in C++ as it sorts the following array into ascending order. List the calls to mergesort and to merge in the order in which they occur.
10, 40, 20, 12, 30, 15
Here is how i mad the human merge.
10,40,20,12 30,15
10,40 20, 12 30,15
10,40 20,12 30,15
10,40 12,20 15,30
10,12,20,40 15,30
10,12,15,20,30,40
How would i go about implementing this solution in c++?.
What does the question mean list the calls to merge sort?.
Answer> How would i go about implementing this solution in c++?.
see:
http://en.wikipedia.org/wiki/Merge_sort
> What does the question mean list the calls to merge sort?.
Merge sort is usually implemented recursively. So this means trace all the recursive calls to the merge sort function.