8. Consider ternary search–the following algorithm for searching in a
sorted array [0 −1].If=1simply compare the search key
with the single element of the array; otherwise, search recursively by com-
paring with [b3c]and if is larger, compare it with [b23c]to
determine in which third of the array to continue the search.
a. What design technique is this algorithm based on?
9. An array [0 −2] contains −1integers from 1 to in increasing
order. (Thus one integer in this range is missing.) Design the most
efficient algorithm you can to find the missing integer and indicate its
time efficiency.
10. a. Write a pseudocode for the divide-into-three algorithm for the fake-coin
problem. Make sure that your algorithm handles properly all values of ,
11. a. Apply the Russian peasant algorithm to compute 26 ·47
b. From the standpoint of time efficiency, does it matter whether we
multiply by or by by the Russian peasant algorithm?
12. a. Write pseudocode for the Russian peasant multiplication algorithm.
29