Course Solutions Uncategorized (Solved) : Median List 2n 1 Distinct Numbers Element M List Exactly N Numbers Less M Exactly N Number Q35887796 . . . .

(Solved) : Median List 2n 1 Distinct Numbers Element M List Exactly N Numbers Less M Exactly N Number Q35887796 . . . .

 

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

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post