Part A: Implement recursive merge sort.

Part B: Terminate the recursion for merge sort, when the size of the segment is at most 8 (H - L <= 8), and then use insertion sort.

For part A write a program for merge sort using C/C++ programming language. Take your array size to be 1000.You should use recursive Merge sort.

For part B combine merge sort with insertion sort, where you cut the array into two (almost) equal parts. You should terminate the recursion for merge sort, when the size of the segment is at most 8 (H - L <= 8), and then use insertion sort.

Your program should read from a file called data1.txt and write to a file called out1.txt. Your program must sort the numbers in each line in the input file. You should follow the best practices in writing your code. Include source code and a read me file with all the necessary information about the program .

Example input:

2.5 600 -2 100
200 400 20.57 36

Example Output:

-2 2.5 100 600
20.57 36 200 400
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.