Professional Documents
Culture Documents
By
Ravi Kant Sahu
Asst. Professor
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Header Linked List
A header linked list which always contains a special
node, called the header node, at the beginning of the
list.
START
Ø
HEADER NODE
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Header Linked List
• This header node need not represent the same type of data that
succeeding nodes do.
• Header node can access the data of all the nodes in the linked
list.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Types of Header Linked List
A Grounded header list is a header list where the last node
contains the null pointer.
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.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
START
Ø
HEADER NODE
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
START
HEADER NODE
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
• If Link [START] = NULL,
then, Grounded Header List is Empty.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Traversing a Circuar Header List
Algorithm (Traversing a Circular Header list)
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Use of Header Linked List
• Header Linked lists are frequently used for maintaining
Polynomials in memory.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Review Questions
• What is Header Node?
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)