# a general structure for a seach SEARCH: while ( 1 ) { # keep searching until we find what we want or discover it # isn't there # stop if the thing we are looking cannot be found if ( search space is empty ) { # thing we are looking for is not present last SEARCH; } # probe the search space, that is, pick a spot in the search # space and take a look # stop if we find it if ( thing found ) { # thing we are looking for is present last SEARCH; } # narrow down the search space and keep looking }