Section 7.1
7 Standard Algorithms
7.1 Linear Searches
If we have a table of data stored in an array (or ifle) the most straightforward
way to find a record is to examine each record until we find the one we want.
7.1.1 Linear Searches
If our data items are stored in no particular order then a linear search of these
items is called a serial search.
If the data items are in key sequence then a linear search is called a sequential
search.
The search can be abandoned either when the record is found or the search goes
past the item been sought.
Pseudocode
Input search key value
Open sequential file for input
Load array into file into memory as array
DO
    IF record matches THEN
       matchflag = 1
       EXIT DO
    ELSE IF search value > current record THEN
       matchflag = 0
       EXIT DO
    END IF
    Increment counter
LOOP end of file / end of array data
Display results