Am to
1) count the number of comparisons needed to sort the k-Way merge to sort an arbitrary permutation of numbers from 0 to N-1.
2)
to count the number of data moves needed to sort a K-Way merge o sort a random permutation of numbers from 0 to N-1.
I understand how 2-way merge sorting works correctly and understands the code very well. My problem now is that I donβt know where to start, and you need a little help. How to convert two-way sorting to K-Way so that I can solve the above problems.
I have some time to search on Google, but I canβt find any tutorial to help me very well understand k-Way merge sort.
I need a good explanation of what to do so that I can take it from there and do it myself.
As I said, I understand 2-Way, so how can I go on to sort the K-Way merge? How to implement a K-way.
Thanks for the help.
EDIT
** I read the post http://bchalk.com/work/view/k_way_merge_sort that BinaryHeap should be used to implement k-Way merge. Is this true or are there other ways?
** How do I divide my list by K? Is there a special way to do this?
source share