worst case

The input of a given size that makes an algorithm do the most work, and the cost on that input.

In more detail

For linear search, the worst case is a target that is missing or sits at the end, so every element is checked. Worst-case bounds are guarantees: no input of that size can cost more. Attackers deliberately aim for worst cases, which is why hash flooding and sorted input to an unbalanced tree matter.

Related terms

Taught in

References