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
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
Get step-by-step solutions from verified subject matter experts
