1. 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...



1.
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.


Nov 18, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here