Find the Median

  • + 0 comments

    Java:

    public static int findMedian(List<Integer> arr) {
    	Collections.sort(arr);
    	return arr.get((arr.size() - 1) / 2);
    }