Question: Implement the iterative version of merge sort(lst) Part A: Merge Write a function merge (Ist1, 1st2) that takes two sorted lists as arguments, and returns

Implement the iterative version of merge sort(lst)

Implement the iterative version of merge sort(lst) Part A: Merge Write afunction merge (Ist1, 1st2) that takes two sorted lists as arguments, andreturns the elements of both lists, merged. This function must have a

Part A: Merge Write a function merge (Ist1, 1st2) that takes two sorted lists as arguments, and returns the elements of both lists, merged. This function must have a complexity of O(n + m) where a list the length of 1at1 and m is the length of 1at2.Part B: Merge Sort Implement the iterative version of merge_sort (Ist), where Ist is an unsorted list, you should also return the sorted list. Your code should call merge (1at1, Ist2) from Part A.def merge sort (let) : Input: list of elements Output: Sorted list of elements merge sort ([3, 7, 9, 6, [1, 2, 3, 4, 5, 6, 7, 8, 9] 2, 5, 4, 1, 8] ) merge sort ([11, 0, 1, 5, 7, 2] ) [0, 1, 2, 5, 7, 11] > > > CO, merge_sort ([10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0] ) 1, 3, 4, 5, 6, 7, 8, 9, 10] pass

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 Programming Questions!