Continuing from Exercise 7.25, after part (a), a. Perform a test so that the smaller subarray is
Question:
a. Perform a test so that the smaller subarray is processed by the first recursive call, while the larger subarray is processed by the second recursive call.
b. Remove the tail recursion by writing a while loop and altering left or right, as necessary.
c. Prove that the number of recursive calls is logarithmic in the worst case.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Data Structures and Algorithm Analysis in Java
ISBN: 978-0132576277
3rd edition
Authors: Mark A. Weiss
Question Posted: