Question: 8) What does the following method do? Rewrite it so it produces the same results but does not use recursion. public static boolean whoKnows
8) What does the following method do? Rewrite it so it produces the same results but does not use recursion. public static boolean whoKnows (int arr, int i, int j) { if (i >= j) { return true; } else { int mid = (i + j) / 2; boolean leftOk == whoKnows (arr, i, mid); } } boolean right0k = whoKnows (arr, mid + 1, j); return leftOk && rightOk && arr[mid]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
