The worst-case time complexity of binary search on n sorted elements is:
Show answerHide answer
Correct answer: (D) O(log n)
Explanation
Each step halves the search space.
Correct answer: (D) O(log n)
Explanation
Each step halves the search space.
This is question 146 of DSSSB TGT Computer Science Full Mock Test 1. 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.