Question 60Asked in DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)

Which of the following statements is correct about the divide and conquer approach of binary

Which of the following statements is correct about the divide and conquer approach of binary search technique?
  1. AThe recurrence relation of binary search is written as T(n) = 2T(n/2) + O(1), where n is the number of elements in the array.
  2. BThe worst-case time complexity of binary search is O(log n).
  3. CThe best-case time complexity of binary search is O(log n).
  4. DThe average-case time complexity of binary search is O(n).
Show answerHide answer

Correct answer: (B) The worst-case time complexity of binary search is O(log n).

Explanation

Each step compares with the middle element and discards half the array, so T(n) = T(n/2) + O(1), giving O(log n) in the worst case. The best case is O(1) and the average case is O(log n), and the recurrence has T(n/2) once, not twice.

From DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 1 (9:00 AM)

This is question 60 of DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 1 (9:00 AM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.