LIST Unsorted 1.Set PTR := START 2.Repeat Step 3 while PTR=NULL 3.If ITEM = INFO[PTR], then : Set LOC := PTR and Exit else Set PTR:=LINK[PTR] [PTR points to next node] [End of If structure] [End of Step 2 loop] 4.[Search unsuccessful] Set LOC:=NULL 5. Exit
LIST Sorted 1.Set PTR := START 2.Repeat Step 3 while PTR=NULL 3.If ITEM < INFO[PTR], then : Set PTR:=LINK[PTR] [move to next node] elseif ITEM = INFO[PTR], then: Set LOC := PTR and Exit [search successful] else: Set LOC:=NULL and exit [ITEM exceeds INFO[PTR]] [End of If structure] [End of Step 2 loop] 4.[Search unsuccessful] Set LOC:=NULL 5. Exit
Header Linked List A header linked list is the LL which will always contain a special node called “header node” at the beginning of the list. START pointer will now point to the HEADER NODE and HEADER NODE will now point to the first “actual node” of linked list.
Header Linked List a) Grounded header LL b) Circular header LL a) Grounded header LL b) Circular header LL START N Header Node
Polynomial
Two way lists In one way link list we can traverse in one direction, i.e. in forward direction from START We cannot traverse in backward direction or we can’t access the preceding nodes without traversing the part of LL
Two way lists In two way LL, we can traverse in two direction: 1) Forward direction from beginning of LL to its end 2) Backward direction from end of LL to its beginning Also we now access to both next and previous node of the LL.
Two way lists Each node now contains three parts: 1)INFO : contain data 2)FORW: contain address of next node 3)BACK: contain address of previous node
Two way circular header LL