Why is linear scan the brute-force baseline?

Practice this question from Binary Search - Classic search Pattern Practice Quiz, with options and an explanation.

Question

Why is linear scan the brute-force baseline?

Option A — Correct answer

It checks one element at a time and costs O(n)

Option B

It halves the range

Option C

It uses too much recursion

Option D

It requires a hash map

Explanation

It checks elements one by one and ignores sorted order, so it costs O(n).

Binary Search - Classic search Pattern Practice Quiz

All questions · Previous question · Next question

Open on QuizMaker