Locating information in a table or file by reference to a special field of each record, called the key. The goal of the search is to discover a record (if any) with a given key value. There are many different algorithms for searching, principally depending on the way in which the table or file is structured.
If a record is to be inserted in the file, and it is important to ensure that keys are unique, then a search is necessary: the insertion may take place as soon as the search has discovered that no existing record has the new key. Such an algorithm is known as a search and insertion algorithm.
See also table lookup, sequential search algorithm, binary search algorithm, breadth-first search, depth-first search, trie search, heuristic search.