Question: Please code exactly as the algorithm gave.Please do the same Kindly Solve C or C++ mergesort(L,length print) // L is a list of numbers, length

Please code exactly as the algorithm gave.Please do the same

Kindly Solve C or C++

Please code exactly as the algorithm gave.Please do the same Kindly Solve

mergesort(L,length print) // L is a list of numbers, length is the number of elements in L 1. if(print = 1), then print the entire list L on a new line. 2. Break the list L into two parts list and list of (roughly) equal lengths 11 and 12. 3. Recursively sort L1 and L2. 4. Let L' be an empty list. 5. j=k=0. 6. while j = 11) add all the remaining elements of L2 to the end of L'. 8. else add all the remaining elements of L1 to the end of L'. Download the files arrayMergeSort.cpp, arrayMergeSortheader.h, listMergeSort.cpp and listMergeSortheader.h. 1. Write a routine void mergesort (int *arrayi, int *array2, int start, int end, int print) which sorts the part of the input arrayi from array1 [start] to array1 [end] using the mergesort algorithm above. You can use array2 for the merging part of the algorithm (as L'). Copy the contents of array2 back into arrayl before you return

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!