Skip to content

Algorithms

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.

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

More Algorithms MCQs