Question: java program Someone proposes an algorithm to find the median of a series of N numbers (all different and given in a random order) contained

java program

java program Someone proposes an algorithm to find the median of a

Someone proposes an algorithm to find the median of a series of N numbers (all different and given in a random order) contained in a simple array, where N is an odd number For example, if N-5 and the numbers in the array are 13,2,7,4,3 the median is 4 (the "middle" element) The idea of this programmer is to go over each number and to find how many numbers in the array are smaller than this one. You do this for every number until you find one for which there are exactly (N-1)/2 smaller numbers; at this point you may stop and this number is the median A) (15 pt) Give a pseudo-code description of the algorithm described above B) (15 pt) Give a big-h complexity for the best-case and for the worst-case running time (of course, give the tightest big-Oh you can for each case). Justify your answers

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