Home
Answers
Viewqa
Java-Interview-Questions
identify the order of the average running time of the method

QuestionAsk Questions?

Posted in : Java Interview Questions

public static double getMedian (double[] A) { // given an ordered array of length n, return the median int n = A.length; if ((n % 2) == 1) return A[n/2]; else return (A[n/2 - 1] + A[n/2]) / 2.0; }

View Answers

Related Tutorials/Questions & Answers:

Advertisements