public static double kthLargest(double[] v, int k) {double r = Double.NaN;int index = k-1; if (v!=null && v.length > index && index >= 0) {Arrays.sort(v);r = v[v.length-index-1];}return r;}

public static double kthLargest(double[] v, int k){double r = double.NaN;k--; if (v != null && v.Length > k && k >= 0){Array.Sort(v);r = v[v.Length - k - 1];}return r;}
