1.

Under what case of Master’s theorem will the recurrence relation of binary search fall?(a) 1(b) 2(c) 3(d) It cannot be solved using master’s theoremThe question was asked in examination.My doubt stems from Masters theorem in section Recursion of Data Structures & Algorithms II

Answer»

Right answer is (b) 2

Best explanation: The recurrence relation of BINARY search is given by T(N) = T(n/2) + O(1). So we can OBSERVE that c = Logba so it will fall under case 2 of master’s theorem.



Discussion

No Comment Found

Related InterviewSolutions