What is the worst-case time complexity of search operation on unordered and…

2022

What is the worst-case time complexity of search operation on unordered and ordered list using linear search algorithm respectively?

  1. A.

    O(n) and O(1)

  2. B.

    O(n) and O(log n)

  3. C.

    O(n) and O(n)

  4. D.

    O(log n) and O(log n)

Attempted by 811 students.

Show answer & explanation

Correct answer: C

Linear search always scans elements one-by-one. Unordered list → worst case O(n)

Ordered list → still worst case O(n) because the target may be at the end or absent.

✔ Answer = O(n), O(n)

Explore the full course: Up Lt Grade Assistant Teacher 2025