SSC IMD SA Mock 04 – Question 172

Question:

What is the time complexity of searching for an element in an array of size \(n\) using Binary Search? (Variant 85)
\(n\) आकार के सॉर्टेड ऐरे में बाइनरी सर्च का उपयोग करके किसी तत्व को खोजने की समय जटिलता क्या है? (प्रकार 85)

Options:

  • \(O(\log n)\)
  • \(O(n)\)
  • \(O(1)\)
  • \(O(n \log n)\)
  • \(O(\log n)\)
  • \(O(n)\)
  • \(O(1)\)
  • \(O(n \log n)\)

Correct Answer: a)

Explanation:

Binary Search halves the search space at each step: \(T(n) = T(n/2) + O(1) \implies O(\log n)\).
प्रत्येक चरण में खोज का दायरा आधा हो जाता है, अतः समय \(O(\log n)\) होता है।

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top