Question: Mergesort is a complicated process, but what is it actually doing? We are going to take a closer look at the process in this exercise.
Mergesort is a complicated process, but what is it actually doing? We are going to take a closer look at the process in this exercise.
You are given the merge sort algorithm and you need to add some print statements so that you can see what actually is happening.
Add a print statement at each step, as well as print out the array each time. Your output needs to match the sample below. Here is a portion of a sort as an example:
Unsorted:
Splitting
Left Half:
Right Half:
Splitting
Left Half:
Right Half:
Splitting
Left Half:
Right Half:
Merging
Sorted so Far:
Merging
Sorted so Far:
Merging
Sorted so Far:
Merging
Sorted so Far:
Sorted:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
