Computing Atlas

How Computing Was Built
Sign In
Text size
100%
Theme
Algorithm

Linear Search

Searching Algorithm

Linear search, also called sequential search, is a method for finding an element within a list by checking each element in sequence until a match is found or the whole list has been searched. It runs in linear time in the worst case, making at most n comparisons on a list of length n, and needs no precondition on how the list is ordered, unlike faster searches such as binary search that require a sorted list. This description is adapted from Wikipedia contributors under CC BY-SA 4.0; changes were made. https://creativecommons.org/licenses/by-sa/4.0/

Facts
Time Complexity
Worst-case O(n), best-case O(1), average O(n). 1
Sources
1. Wikipedia: Linear Search
Wikimedia FoundationLead section
Quote, Lead section
A linear search runs in linear time in the worst case, and makes at most n comparisons, where n is the length of the list.
View the Source
Comments (0)
No comments yet. Be the first to share a thought.
Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.