Question: Q 7 - 1 . Merge sort Write a program to sort a group of integers in increasing order using merge sort. Prompt the user
Q Merge sort
Write a program to sort a group of integers in increasing order using merge sort. Prompt the user
to get how many integers need to be sorted. Accept the valid positive value for the count
of int elements.
If a valid number number of elements is entered, prompt the user to enter
those many as the count of elements provided in the previous step integer elements ignore
cases to check that each value is integer assume user enters integers Accept the elements in
an array. Then sort the entered values using merge sort and print the sorted list.
Your program must call a separate function like mergesort which should be defined in
a separate file. This function should be called from main You must figure out the arguments
and the return type and define the interface. The actual array or list of integers to be sorted may
not be global.
You will benefit from studying the merge sort algorithm before you come to the lab. You
are free to bring a merge sort algorithm or pseudocode to the lab.
Output submission with at least one case with multiple occurrences of a few entries
Implementation using pointers and dynamic memory allocation rather than arrays and static
memory allocation
For a project you may choose to scale this to read numbers from a file, sort them and
write back to the same or a different file.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
