SparkNotes Shopping Cart  |     |  Checkout
Brought to you by Barnes and Noble
  Home : Math & Science : Computer Science Study Guides : Searching : Linear : Introduction and Summary
Linear Search
  
 
Introduction and Summary
The sequential search, also known as the linear search, are the most basic search algorithms and are often the first search method learned in introductory computer science courses.
The basic strategy is straightforward. Every element in the data set is examined in the order presented until the value being searched for is found. If the value being searched for doesn't exist, a flag value is returned (such as -1 for an array or NULL for a linked list).
Sequential search is at best O(1), at worst O(n), and on average O(n). If the data being searched are not sorted, then it is a relatively efficient search. However, if the data being searched are sorted, we can do much better.
Help | Feedback | Make a request | Report an error | Send to a friend
 
Study right for the SAT II Chemistry test with the experts at SparkNotes.
More...
 
SparkNotes Study Cards boil down Chemistry into digestible tidbits, making studying easier.
More...
 
 
Go to top