Question: python 3. (6 points) Write a function called merge sort that takes a list and return a sorted copy. The following pseudo-code describes the merge

python python 3. (6 points) Write a function called merge sort that takes

3. (6 points) Write a function called merge sort that takes a list and return a sorted copy. The following pseudo-code describes the merge sort algorithm. It uses recurisve calls, where a function is called inside its definition. Merge Sort (1) (a) if the length of the list / is 1 return the list (b) if the length of the list / is more than 1 split it into two halfs i. Sort the first half using merge sort (recursive call) ii. Sort the second half using merge sort (recursive call) iii. Combine both halfs using the merge function from question (2) above iv. return the resulting list Test your function with the following line of code. print(merge_sort([2, 3, 3, -1, 22, 19, 100, 4, 5, 12])) You should get the following output [-1, 2, 3, 3, 4, 5, 12, 19, 22, 100] Process finished with exit code 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!