Median
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
http://www.lintcode.com/en/problem/median/
Given a unsorted array with integers, find the median of it.
A median is the middle number of the array after it is sorted.
If there are even numbers in the array, return the N/2-th number after sorted.
public class Solution {
public int median(int[] nums) {
if (nums == null || nums.length == 0) return -1