logo

Question detail

What does the time complexity O(n) mean for a linear search?

Try the question, check the answer, then read the explanation to understand the curriculum point.

At a glance

MCQ

Type

practice

Style

Topic

Searching algorithms

Exam-style question

Try this first

What does the time complexity O(n) mean for a linear search?.

  1. A.The number of comparisons is unrelated to the number of items.
  2. B.The number of comparisons can grow in proportion to the number of items.
  3. C.The search always makes exactly one comparison.
  4. D.The search always makes the same number of comparisons as a binary search.

Model answer

What a good answer should say

  • The number of comparisons can grow in proportion to the number of items.

Explanation

Why this works

For a list with n items, a linear search may need to examine each item. Therefore, the amount of work grows linearly as n increases, giving a time complexity of O(n).

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.