Procedure: FINDBHL(INFO, LINK, START, ITEM, LOC, LOCP)
1. Set SAVE : = START and PTR : = LINK[START]. [Initializes pointer].
2. Repeat while INFO[PTR] != ITEM and PTR != START.
Set SAVE : = PTR and PTR : = LINK[PTR]. [Updates Pointers]
[End of loop]
3. If INFO[PTR] = ITEM, then:
Set LOC : = PTR and LOCP : = SAVE.
Else:
Set LOC : = NULL and LOCP : = SAVE.
[End of If structure]
0 comments:
Post a Comment