Britannica Sources used in this answer

Why does searching a list one item at a time have linear time complexity?

Created from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.

Searching a list one item at a time has linear time complexity, denoted as O(n), because the number of operations required to complete the task grows in direct proportion to the size of the input, n.1

In this context, n represents the total number of records in the list. When you examine each element sequentially, the time required to finish the search increases linearly as n increases. For example, if you have a list of 1,000 records, the search will take roughly 10 times longer than it would for a list of 100 records, because the algorithm must perform a proportional number of operations to check each additional item.1

This relationship is a fundamental concept in time complexity, which uses big-O notation to describe how the execution time of an algorithm scales as the input size grows.1