Data Structures Header Linked List Outlines Introduction Header








![• If Link [START] = NULL, then, Grounded Header List is Empty. • • If Link [START] = NULL, then, Grounded Header List is Empty. •](https://slidetodoc.com/presentation_image_h2/4fd9b3a76db41686f3be285c0a6a82f1/image-9.jpg)




- Slides: 13

Data Structures Header Linked List

Outlines • • • Introduction Header Linked List Advantages of Header Linked List Types of Header Linked List Review Questions

Header Linked List q A header linked list which always contains a special node, called the header node, at the beginning of the list. START Ø HEADER NODE

Header Linked List Name START AVAIL 2 10 1 2 3 LINK 0 5 59, 000 6 E 10000 9 C 4000 7 4 5 6 7 8 9 10 Salary 8 B 20000 4 D 13000 3 1 F 12000 2 5

Advantages of Header Linked List • Header linked list contains a special node at the top. • This header node need not represent the same type of data that succeeding nodes do. • It can have data like, number of nodes, any other data. . . • Header node can access the data of all the nodes in the linked list.

Types of Header Linked List q A Grounded header list is a header list where the last node contains the null pointer. q A Circular header list is a header list where the last node points back to the header node. Note: • Unless otherwise stated or implied, header list will always be circular list. • Accordingly, in such a case, the header node also acts as a sentinel indicating the end of the list.

START Ø HEADER NODE Grounded Header List

START HEADER NODE Circular Header List
![If Link START NULL then Grounded Header List is Empty • If Link [START] = NULL, then, Grounded Header List is Empty. •](https://slidetodoc.com/presentation_image_h2/4fd9b3a76db41686f3be285c0a6a82f1/image-9.jpg)
• If Link [START] = NULL, then, Grounded Header List is Empty. • If Link [START] = START, then, Circular Header List is Empty.

Traversing a Circuar Header List q Algorithm (Traversing a Circular Header list) 1. Set PTR = LINK [START]. [Initialize pointer PTR] 2. Repeat step 3 and 4 while PTR ≠ START. 3. Apply PROCESS to INFO[PTR]. 4. Set PTR = LINK [PTR]. [PTR points to next node] [End of Step 2 Loop. ] 5. EXIT

Use of Header Linked List • Header Linked lists are frequently used for maintaining Polynomials in memory.


Review Questions • What is Header Node? • How a Linked List is different from Header linked list? • What is Grounded Header list and circular header list?