Hi,
I have to code bottom-up mergesort and natural mergesort (array).
I've got the previous one already.
I need help with natural mergesort.
I've read some lesson/explanations on it, but i don't quite get the splitting part.
I wanna use the same merge func as my BU mergesort if possible.
Let's say i have a list :
2 , 1 , 4 , 5 , 3 , 6 , 1
would the splits be like..
-2 | 3 , 6
-1 , 4 , 5 | 1
and then...
-2
-3 , 6
-1 , 4 , 5
-1
then the merge begins?
My problem is i'm not quite sure of how to implement the runs and splits...would it be a recursion of the sort function?
thx



LinkBack URL
About LinkBacks





)