The document describes a search algorithm to find the location of an item in a linked list. It involves the following steps:
1. Initialize a pointer PTR to the start node of the linked list.
2. Repeat step 3 while PTR is not NULL.
3. If the item is greater than the info at PTR, set PTR to the link at PTR. Else if the item is equal to the info at PTR, set the location to PTR and exit. Else set the location to NULL and exit.
2. 100 21
INFO LINK
300 41
200 31
400 51
500 NULL
41
21
31
51
1. Set PTR:= START
START=11
ITEM=300
LOC=?
11
Add
PTR=
3. 100 21
INFO LINK
300 41
200 31
400 51
500 NULL
41
21
31
51
2. Repeat Step 3 while PTR≠NULL
START=11
ITEM=300
LOC=?
11
Add
PTR=
4. 100 21
INFO LINK
300 41
200 31
400 51
500 NULL
41
21
31
51
3. If ITEM>INFO[PTR]
START=11
ITEM=300
LOC=?
11
Add
PTR=
Means
300>100
5. 100 21
INFO LINK
300 41
200 31
400 51
500 NULL
41
21
31
51
3. If ITEM>INFO[PTR] then
Set PTR:= LINK[PTR]
START=11
ITEM=300
LOC=?
11
Add
PTR=
Means
300>100
6. 100 21
INFO LINK
300 41
200 31
400 51
500 NULL
41
21
31
51
3. If ITEM>INFO[PTR] then
Set PTR:= LINK[PTR]
START=11
ITEM=300
LOC=?
11
Add
PTR=
300>300
7. 100 21
INFO LINK
300 41
200 31
400 51
500 NULL
41
21
31
51
3. If ITEM>INFO[PTR] then
Set PTR:= LINK[PTR]
Else if ITEM=INFO[PTR]
SET LOC=PTR and EXIT
START=11
ITEM=300
LOC= 21
11
Add
PTR=
300=300
8. 100 21
INFO LINK
300 41
200 31
400 51
500 NULL
41
21
31
51
3. If ITEM>INFO[PTR] then
Set PTR:= LINK[PTR]
Else if ITEM=INFO[PTR]
SET LOC=PTR and EXIT
Else Set LOC:= NULL and Exit
START=11
ITEM=300
LOC= 21
11
Add
PTR=
300=300