Sunday 16 December 2012

USE OF HEADER NODE IN LINKED LIST

The header node is a node of linked list which may or may not have the same data structure of that of a typical node.The only common thing between a typical node and a header node is that they both have a pointer pointing to a typical node.

Such a node can be used to store some extra pointers,for example

1)In a circular linked list it may store a pointer to middle node or an integer that stores the total number of nodes of the list.

2) In a simple linked list it may store a sentinel value like total number of nodes in the list or may point to the last node of the linked list.

No comments:

Post a Comment