Question
Consider the following variant of binary search in a sorted array A[1] A[n] for x: instead of comparing x with the element of A at
Consider the following variant of binary search in a sorted array A[1] A[n] for x: instead of comparing x with the element of A at the half-way-point from the left end of A, we instead compare it with the element of A that is at the three-quarters-of-a-way-point from the left end of A.
(a) In the worst case for searching, and compared to the standard binary search, would the actual number of comparisons increase, decrease, or stay the same? Briefly justify.
(b) What is the bound now for searching n items? Briefly justify.
(c) Does your answer to (b) contradict your answer to (a)? Briefly justify.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started