previous |
start |
next
Searching
- If you want to find a number in a sequence of
values that occur in arbitrary order, you must look through all
elements until you have found a match or until you reach the
end.
- This is called a linear or
sequential search.
- There is nothing you can do to speed up the
search.
- The procedure returns the index of the match,
or a -1 if the value cannot be found.
previous |
start |
next