Skip to content
Related Articles

Related Articles

ISRO | ISRO CS 2017 – May | Question 14
  • Last Updated : 20 Mar, 2018

The recurrence relation that arises in relation with the complexity of binary search is:
(A) T(n) = 2T(n/ 2) + k , where k is constant
(B) T(n) = T(n / 2) + k , where k is constant
(C) T(n) = T(n / 2) + log n
(D) T(n) = T(n / 2) + n


Answer: (B)

Explanation: Binary Search is a linear searching algorithm and takes O(log n) when array is sorted. Refer: Binary Search
T(n) = T(n / 2) + k , where k is constant produces a complexity of O(log n)

Quiz of this Question

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :