The median of a list of numbers is essentially it's middle element after sorting. The same number of elements occur after it as before. Given a list of numbers with an odd number of elements, can you find the median?
For example, the median of is , the middle element in the sorted array.
Complete the findMedian function in the editor below. It must return an integer that represents the median of the array.
findMedian has the following parameter(s):
arr: an unsorted array of integers
The first line contains the integer , the size of .
The second line contains space-separated integers