(Traversing a Circular Header List) Let LIST be a circular header list in memory. This algorithm traverses LIST, applying an operation PROCESS to each node of LIST.
1. Set PTR : = LINK[START]. [Initializes the pointer PTR]
2. Repeat Steps 3 and 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.]
0 comments:
Post a Comment