What is the best case and worst case complexity of ordered linear search?

2025

What is the best case and worst case complexity of ordered linear search?

  1. A.

    O(nlogn), O(logn)

  2. B.

    O(logn), O(nlogn)

  3. C.

    O(n), O(1)

  4. D.

    O(1), O(n)

Attempted by 112 students.

Show answer & explanation

Correct answer: D

Answer: d

Explanation: In ordered linear search, the best case occurs when the target element is found at the first position, requiring only one comparison. This results in a time complexity of O(1). The worst case occurs when the target is at the last position or not present in the array, requiring n comparisons. This results in a time complexity of O(n).

Explore the full course: Coding For Placement