What is the worst-case time complexity of Binary Search?
Difficulty: Medium
About this MCQ
This Medium Algorithms MCQ checks one syllabus fact.
The question is: “What is the worst-case time complexity of Binary Search?”
The accepted answer is B. O(log n). O(log n) is the fact required by “What is the worst-case time complexity of Binary Search” (option B). Option A (“O(n)”) does not match the stem; it is a near-miss used to catch incomplete recall of O(log n). Option C (“O(n log n)”) does not match the stem; it is a near-miss used to catch incomplete recall of O(log n). Remaining alternatives (O(1)) fall outside the same rule and should be eliminated once O(log n) is identified. Algorithms questions of this type reward precise definitions rather than approximate associations. Algorithms recall of this distinction is a regular item in FPSC, PPSC, NTS, and CSS papers.
- A. O(n)
Why not A: “O(n)” is not correct. The accepted answer is B. O(log n). O(log n) is the fact required by “What is the worst-case time complexity of Binary Search” (option B). Option A (“O(n)”) does not match the stem; it is a near-miss used to catch in
- B. O(log n) ✓
- C. O(n log n)
Why not C: “O(n log n)” is not correct. The accepted answer is B. O(log n). O(log n) is the fact required by “What is the worst-case time complexity of Binary Search” (option B). Option A (“O(n)”) does not match the stem; it is a near-miss used to catch in
- D. O(1)
Why not D: “O(1)” is not correct. The accepted answer is B. O(log n). O(log n) is the fact required by “What is the worst-case time complexity of Binary Search” (option B). Option A (“O(n)”) does not match the stem; it is a near-miss used to catch in
Correct answer
B. O(log n)
Explanation
O(log n) is the fact required by “What is the worst-case time complexity of Binary Search” (option B). Option A (“O(n)”) does not match the stem; it is a near-miss used to catch incomplete recall of O(log n). Option C (“O(n log n)”) does not match the stem; it is a near-miss used to catch incomplete recall of O(log n). Remaining alternatives (O(1)) fall outside the same rule and should be eliminated once O(log n) is identified. Algorithms questions of this type reward precise definitions rather than approximate associations. Algorithms recall of this distinction is a regular item in FPSC, PPSC, NTS, and CSS papers.
Source: Algorithms Reference Guide
Tags: algorithms, binary search, complexity
Submitted by: MCQsHub Editorial
Related MCQs
- Sample Computer Science MCQ #497: Which option is correct regarding Algorithms?
- Sample Computer Science MCQ #487: Which option is correct regarding Algorithms?
- Sample Computer Science MCQ #477: Which option is correct regarding Algorithms?
- Sample Computer Science MCQ #467: Which option is correct regarding Algorithms?
- What does Binary search refer to?
- What is the name for a simple sorting algorithm that repeatedly swaps adjacent elements if they are in the wro...