Question: Merge sort involves recursively splitting the array into 2 parts, sorting and finally merging them. A variant of merge sort is called 3-way merge

Merge sort involves recursively splitting the array into 2 parts, sorting and

 finally merging them. A variant of merge sort is called 3-way merge 

Merge sort involves recursively splitting the array into 2 parts, sorting and finally merging them. A variant of merge sort is called 3-way merge sort where instead of splitting the array into 2 parts we split it into 3 parts. As shown in the MergeSort code, it recursively breaks down the arrays to subarrays of size half. Similarly, 3-way Merge sort breaks down the arrays to subarrays of size one third. In this question, you need to implement the 3-way Merge sort algorithm (in function mergeSort_3_way) in a descending order. During the sorting, count the number of comparisons in each merge stage.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Steps to implement the 3way merge sort algorithm in descending order and count the number of compari... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Algorithms Questions!