The question is intended as a self-test for readers. Answers may be found in Appendix C.
We’ve seen that recursion can take the place of a loop, as in the loop-oriented orderedArray. java program (Listing 2.4) and the recursive binarySearch. java program (Listing 6.3). Which of the following is not true?
a. Both programs divide the range repeatedly in half.
b. If the key is not found, the loop version returns because the range bounds cross, but the recursive version occurs because it reaches the bottom recursion level.
c. If the key is found, the loop version returns from the entire method, whereas the recursive version returns from only one level of recursion.
d. In the recursive version the range to be searched must be specified in the arguments, while in the loop version it need not be.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.