Question: Problem Statement Given an array of size ' n ' , sort the array in ascending order using Merge Sort algorithm and find out the

Problem Statement
Given an array of size 'n', sort the array in ascending order using Merge Sort algorithm and find out the median value. The median is the value that is present in the middle of a sorted array containing odd number of values. If the sorted array contains even number of values, median is the average of middle two values.
Implement the functionalities based on the description given below.
Method Description
mergeSort(int[] elements, int size)
Sort the array using the merge sort algorithm
merge(int[] elements, int[] left, int[] right, int leftMerge, int rightMerge)
Merge the left array and right array to produce new sorted arrays
findMedian(int elements[])
Find out and return the median value
Test the functionalities using the main() method of the Tester class.
Sample Input and Output
\table[[Sample Input,Expected Output],[arr =[64,34,25,12,22,11,90],12.0],[art =[10,20,30,40],25.0]]
Download the Java project from here to solve this exereise in Eclipse
Problem Statement Given an array of size ' n ' ,

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