Today we will learn about SEARCHING in UNSORTED linked list.
1) Algorithm.
1] set PTR:=START.
2]Repeat Step 3 while START !=NULL.
3] if ITEM== INFO[PTR] then,
Set LOC= PTR and EXIT.
Else
Set PTR=LINK [PTR] .
(End Of Step 2 loop)
4] [search Not successful ? ] LOC=NULL
5] EXIT.
PICTURE :- Refer from
https://www.w3resource.com/c-programming-exercises/linked_list/c-linked_list-exercise-10.php
0 Comments