1. [List of empty?] If START = NULL, then : Set LOC : = NULL, and Return.
2. [Special case?] If ITEM < INFO[START], then : Set LOC : = NULL, and Return.
3. Set SAVE : = START and PTR : = LINK[START]. [Initializes pointers]
4. Repeat Steps 5 and 6 while PTR != NULL.
5. If ITEM < INFO[PTR], then:
Set LOC : = SAVE, and Return.
[End of If structure]
[End of If structure]
6. Set SAVE : = PTR and PTR : = LINK[PTR]. [Updates Pointers]
[End of Step 4 loop]
7. Set LOC : = SAVE
0 comments:
Post a Comment