Slide 6.2: A C++ program for sequential searches Slide 6.4: Unix tools for sequential processing Home |
A sequential search is a search algorithm for searching a set of unsorted data for a particular value. In sequential search, we start from the beginning of the list, scan down the list, until the desired key is found or we have reached the end of the end of the list.We have the following conclusions for a sequential search:
n
records is proportional to n
: it takes at most n
comparisons; on average it takes approximately n/2
comparisons.
It is said to be of the order O(n)
because the time it takes is proportional to n
.
O(n)
means the algorithm is run on some computer on the same type of data but for increasing values of n
, the resulting times will always be less than some constant times |n|
.
O(n)
.