What is the best case runtime of linear search(recursive) algorithm on an…

2024

What is the best case runtime of linear search(recursive) algorithm on an ordered set of elements?

Answer: A. O(1)The best case runtime of linear search occurs when the target element is found at the first position of the array. In this scenario, only one comparison is…

  1. A.

    O(1)

  2. B.

    O(n)

  3. C.

    O(logn)

  4. D.

    O(nx)

Attempted by 362 students.

Show answer & explanation

Correct answer: A

The best case runtime of linear search occurs when the target element is found at the first position of the array.

In this scenario, only one comparison is needed, resulting in constant time complexity.

Therefore, the best case runtime is O(1).

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…