logo

Question detail

What does a linear search do when searching a list for a target value?

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 a linear search do when searching a list for a target value?.

  1. A.It checks items one at a time from the beginning until the target is found or the list ends.
  2. B.It repeatedly checks the middle item and discards half of the list.
  3. C.It sorts the list before checking every item.
  4. D.It compares only the first and last items.

Model answer

What a good answer should say

  • It checks items one at a time from the beginning until the target is found or the list ends.

Explanation

Why this works

A linear search examines list elements sequentially, starting at the first element. It stops when the target is found or when every element has been checked.

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.