What is the worst-case number of arithmetic operations performed by recursive binary search on a sorted array of size ?
View worked solution
Answer: B
The recurrence relation for the number of arithmetic operations performed by a recursive binary search on a sorted array of size is given by:
where is a constant representing the number of basic arithmetic operations (such as addition, subtraction, and division) required to compute the middle index and update the search boundaries in each recursive step.
Solving this recurrence relation using iterative substitution:
Thus, the worst-case number of arithmetic operations is .
Free practice · Your answers on this page are not saved.
