Algorithms

Worst case

The most an algorithm can take or use with the least favorable input. It's used because it's a guarantee.

Example

Searching for a number one by one in a list of 1,000: in the worst case it's last and that's 1,000 steps.

Test yourself: Worst case

Time complexity

Why is the worst-case complexity almost always used?

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.