Question: What does the textbook mean by To do this, consider even and odd values of n seperately? 4. Show that the worst-case time complexity for

What does the textbook mean by "To do this, consider even and odd values of n seperately"?
4. Show that the worst-case time complexity for Binary Search (Algorithm 2.1) is given by W(n)=lgn+1 when n is not restricted to being a power of 2 . Hint: First show that the recurrence equation for W(n) is given by W(n)=1+W(2n)forn>1W(1)=1. To do this, consider even and odd values of n separately. Then use induction to solve the recurrence equation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
