1. [List empty?] If START = NULL, then:
Set LOC: = NULL and LOCP : = NULL, and Return.
[End of If Structure.]
2. [ITEM in first node?] If INFO[START] = ITEM, then:
Set LOC : = START and LOCP = NULL, and Return.
[End of IF Structure]
3. Set SAVE : = START and PTR : = LINK[START]. [Initialize Pointer]
4. Repeat Steps 5 and 6 while PTR != NULL.
5. If INFO[PTR] = ITEM, then:
Set LOC : = PTR and LOCP : = SAVE , and Return.
[End of If Structure]
6. Set SAVE : = PTR and PTR : = LINK[PTR]. [Update Pointer]
[End of Step 4 loop]
7. Set LOC : = NULL. [Search Unsuccessful]
8. Return.
0 comments:
Post a Comment