Professional Documents
Culture Documents
Header Link List/ Circular Link List
Header Link List/ Circular Link List
A B C
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!!!