Question: Please code exactly as the algorithm gave.Please do the same. Note:There are two different questions, so give me different answers . 1.Arry 2.Link list Kindly

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

Note:There are two different questions, so give me different answers . 1.Arry 2.Link list

Kindly Solve C or C++

Please code exactly as the algorithm gave.Please do the same. Note:There are

Assignment 01 CSE 242 Implementing Merge Sort with Arrays and Linked lists 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 list1 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 listMerge Sortheader.h. 1. Write a routine void mergesort (int *array, int *array2, int start, int end, int print) which sorts the part of the input array1 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. 2. Write a routine listElement *mergesort (listElement *first, int length, int print) which sorts the linked list starting with first using the mergesort algorithm above. The algorithm should return the head of the sorted list. You are allowed to discuss the questions, but please do NOT copy code! I might check

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!