Linear Search Formula

The Formula

O(n) time complexity

When to use: Looking for your keys by checking every pocket and drawer in order.

Quick Example

Find 37 in [56,12,37,5,23]: check 56 (no), 12 (no), 37 (yes) โ€” found in 3 steps.

What This Formula Means

A search algorithm that checks each element in a list one by one until the target is found.

Looking for your keys by checking every pocket and drawer in order.

Why This Formula Matters

Works on unsorted data; baseline to compare against more efficient algorithms.

Frequently Asked Questions

What is the Linear Search formula?

A search algorithm that checks each element in a list one by one until the target is found.

How do you use the Linear Search formula?

Looking for your keys by checking every pocket and drawer in order.

Why is the Linear Search formula important in CS Thinking?

Works on unsorted data; baseline to compare against more efficient algorithms.

What do students get wrong about Linear Search?

Linear search works on any list; binary search is faster but requires sorted data.

What should I learn before the Linear Search formula?

Before studying the Linear Search formula, you should understand: searching, array.