Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 6

Header link list/

Circular link list


Header LL
 A LL which always contains a special node,
called the header node, at the beginning of
the list.
 Two types:-
 Grounded Header List: - A header list where the
last node contains the null pointer.
 Circular Header List: - A header list where the
last node points back to the header node.
Schematic Diagrams:
 Grounded Header List
START Header Node

A B C 

 Circular Header List


START Header Node

A B C
Use of Header List
 Header linked lists are frequently used for
maintaining polynomials in memory.
 Circular linked lists are frequently used instead
of ordinary LL because many operations are
much easier to state & implement using header
lists.
Traversing a Circular HL
 Traverse (LIST, PROCESS, LINK)
Let LIST be a circular header list in memory. This algo traverses
LIST, applying an operation PROCESS to each node of LIST.
1. Set PTR := LINK[START]. [Initializes the pointer PTR.]
2. Repeat Steps 3 & 4 while PTR != START:
3. Apply PROCESS to INFO[PTR].
4. Set PTR := LINK[PTR]. [PTR now points to the next node.]
[End of Step 2 loop.]
5. Exit.
Thank You!!!

You might also like