Algorithms

Linear search

Searching for a value by looking at the elements one by one, from the start, until you find it. It costs O(n).

Example

To find 42 in an unsorted list of 1,000 numbers, in the worst case you look at all 1,000.

Test yourself: Linear search

Arrays

What's the complexity of searching for a value in an unsorted array?

Lessons that use it

More algorithms terms

All terms →

Arki, the beaver mascot

Your next interview starts with 5 minutes today.

Free on iOS and Android. Start from zero, no account needed.