Question: I created an algorithm for merge sort and it works, but I need to count the number of comparisons in the merge part since you
I created an algorithm for merge sort and it works, but I need to count the number of comparisons in the merge part since you should include comparisons. Could you please add comparisons to me? PLEASE DO NOT CHANGE MY CODE AND INPUTS OF MY FUNCTION(def merge_sort(a) def merge_sort_recursive(a, low, high) have to be same inputs) YOU CAN CHANGE RETURN VALUE OR INSIDE OF THE CODE. THIS IS EXTREMELY IMPORTANT. TY.

Merge Sort [6]: def merge_sort(a): # Implement the code for merge sort # Use a function merge_sort_recursive to implement the recursive call # Be careful in counting number of comparisons since you should include comparisons in the merge part. # Also: code needs to sort the array a. You may have to copy things over from a temp array back into a. if len(a)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
