An algorithm is an ordered set of unambiguous, executable steps, defining a terminating process.
procedure Search(Phonebook, TargetPhoneNo)
if (Phonebook empty)
then
(Declare the search a failure)
return
else
Select the first entry in the phone book as the test entry
while (test entry's phone number != TargetPhoneNo and
there remain entries left to be considered)
do (Select next entry in Phonebook as test entry)
if (test entry's phone number == TargetPhoneNo)
then
(Declare the search a success)
else
(Declare the search a failure)