arrays - Problems with Javascript Recursion -
I am currently trying to write a script that you want to get back to set the minimum number of "jumps" For an initial array of initial numbers, the initial number is always the largest number in the array. For example, if the array [2, 3, 5, 6, 1] then the starting number will be 6 because it is the largest then you can either go to 6 positions either left or You can bounce right (you can choose) and where you end it is your next number we say that we went right, we will end up on 1 because we loop back in the beginning of the array will do. You can then go to 1 left and then return to 6 . Therefore, the minimum number of jump is 2 . I have written the functions below to take these input array and to determine the minimum number, however, every search function calls 2 times (Once left, and once for the right), still continuously increasing count the variable gets "confused" once the line of repetition ends (when Count> arr.length ) I hope to...