Search Algorithms Summary: We consider a typical problem of computing and a variety of algorithms used to solve that problem.
Introduction To search a data structure is to examine its elements one-by-one until either (a) an element that has a desired property is found or (b) it can be concluded that the structure contains no element with that property. For instance, one might search a vector of integers for an even element, or a vector of pairs for a pair having the string "elephant" as its cdr. You've already encountered a number of forms of searching in Scheme. For example, you've searched lists using assoc. You've also written more general procedures that find multiple elements with particular properties or that find elements based on more than just the car of an element list. We're now reading to think about a more general form of searching, one in which we specify the criterion for searching as a procedure value, rather than hard-coding the particular criterion in the structure of the search.