What is linear search?
Scan elements one by one until the target is found or the end is reached. O(n) time, O(1) space. Works on unsorted data.
DSA · 10 sections
Linear, binary, and advanced search techniques — the most-tested DSA primitive.
Scan elements one by one until the target is found or the end is reached. O(n) time, O(1) space. Works on unsorted data.
Small n, unsorted data, a single search (sorting first costs O(n log n)), or when comparison is cheap and n is tiny.
Append the target to the end as a sentinel so the loop never needs a bounds check; guaranteed termination. Improves the constant factor.
111 more cards in this sheet
Unlock the DSA & Data Structures bundle — ₹399
One-time payment. Unlocks this sheet and 8 other sheets in the bundle, plus a typeset PDF of each.
Unlock the bundle See all bundles
Or get all 76 sheets for ₹999 — one payment, every future sheet included.
What's new and the interview questions people are actually getting asked. No spam.