Why does searching a list one item at a time have linear time complexity?
The x-, y-, and z-axes correspond to components of the weather, while the graph indicates feasible weather patterns. The graph is a function of time, which means, in theory, that tracing the curve in one direction reveals past weather patterns, while tracing the curve in the other direction predicts future weather patterns. However, practically indistinguishable points may lead to completely different weather epochs, indicated by the two distinct “lobes.” This phenomenon, known as sensitivity to initial conditions, is what prevents precise weather forecasts more than a few days into the future.
Searching a list one item at a time has linear time complexity, denoted as , because the number of operations required to complete the task grows in direct proportion to the size of the input, .1
In this context, 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 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