Im suppose to perform this method recursively however when I lauch the program i get an error stating out of bounds. Any suggestions?
// assumes that a != null && a.length > 0 public static int findMin(int[] a) { return findMinRecursive(a, a[0], 1); } private static int findMinRecursive(int[] array, int lo, int pos) { if(pos >= array.length) return lo; if(array[pos] < lo) lo = array[pos]; return findMinRecursive(array, lo, pos + 1); }