Traversal in Single Linked List

Algorithm for Traversal
  • Step 1: First check the head status, if head status is NULL then it is EMPTY LIST.
  • If head status is other then NULL then do...
    • Take a temporary head and assign current head value to th.
    • Design a loop to travel until tail is occur.
    • For every repetition retrieve data field of node and shift th to next link
    • Stop traversal when tail is occur.

Video for Traversal


No comments:

Post a Comment