Saturday, 3 August 2013

Algorithm for Searching

This algorithm finds the location LOC of the node where ITEM first appear in the LIST.
  1. PTR=START
  2. Repeat Step 3 and 4 while PTR !=NULL
  3. If ITEM=INFO[PTR]Set LOC = PTR and ExitElsePTR=LINK[PTR]Set LOC=NULL
  4. Exit

No comments:

Post a Comment