The median of a list of 2n + 1 distinct numbers is the element,m, of the list such that exactly n numbers are less than m andexactly n numbers are greater than m. For example, in the list [3,1, 7, 2, 6], the median is 3.
a) Write an algorithm 1 that computes the median of a list ofnumbers. You may assume the list has an odd number of distinctelements. Please note that correctness and understandability aremore important than efficiency. (4 marks)
b) Give an upper bound for the running time of your algorithmusing big-O notation.
We will now develop a more efficient
PayPal Gateway not configured
PayPal Gateway not configured