engineering computer science MCQ #1214

What is the time complexity of binary search?

engineering computer science MCQ #1214

  1. Question 1

    Q1. What is the time complexity of binary search?

    • A) O(1)
    • B) O(log n)
    • C) O(n)
    • D) O(n log n)

    Answer: O(log n)

    Explanation: Binary search divides the search interval in half with each step, resulting in a time complexity of O(log n) for n elements.