×

Multiple-Choice Questions

Which of the following correctly defines the worst-case time complexity of Linear Search Algorithm?

3. Which of the following correctly defines the worst-case time complexity of Linear Search Algorithm?

  1. O(n)
  2. O(1)
  3. O(nlogn)
  4. O(n2)

Answer

The correct answer is: A) O(n)

Explanation

Linear Search, searches an element sequentially in a list. In the worst case, where an element is not present, the linear search algorithm has to scan all elements leading to O(n).

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.