Each recursive call computes a midpoint and updates a bound using constant arithmetic, then recurses into at most half the remaining interval. There are Θ(log n) calls in the worst case, so total arithmetic operations are Θ(log n), B.
More Searching, Sorting and Hashing questions
GATE 2026 CS (CS1) Q24– Consider a hash table P[0, 1, , 10] that is initially empty. The hash table is maintained…
GATE 2026 CS (CS2) Q30– The keys 5, 28, 19, 15, 26, 33, 12, 17, and 10 are inserted into a hash table using the…
GATE 2025 CS (CS1) Q33– The pseudocode of a function fun() is given below: Let A[0,...,29] be an array storing 30…
GATE 2025 CS (CS2) Q20– Consider an unordered list of N distinct integers. What is the minimum number of element…
GATE 2025 CS (CS2) Q41– An array A of length n with distinct elements is said to be bitonic if there is an index 1…
GATE 2023 CS Q20– An algorithm has to store several keys generated by an adversary in a hash table. The…