Circular linked list
Circular linked list
- In a circular linked list, the last node contains a pointer to the first node of the list.
- can have a circular singly linked list as well as a circular doubly linked list
- While traversing a circular linked list, we can begin at any node and traverse the list in
any direction, forward or backward, until we reach the same node where we started.
- Thus, a circular linked list has no beginning and no ending.
Drawbacks:
- circular linked list is the complexity of iteration.
- Note that there are no NULL values in the NEXT part of any of the nodes of list.
Applications:
- Circular linked lists are widely used in operating systems for task maintenance.
- Surfing the Internet: we can use the Back button and the Forward button to move to the
previous pages that we have already visited.
o A circular linked list is used to maintain the sequence of the Web pages visited.
Traversing this circular linked list either in forward or backward direction helps to
revisit the pages again using Back and Forward buttons.