To insert a node in a circular list at rear position it should be inserted at
To insert a node in a circular list at rear position it should be inserted at rear position.
Circular linked list is a linked list where all nodes are connected to form a circle. There is no null at the end. A circular linked list can be a singly circular linked list or doubly circular linked list
We don’t need to
maintain two pointers for front and rear if we use circular linked list. We can
maintain a pointer to the last inserted node and front can always be obtained
as next of last.
In the circular linked list we can insert elements anywhere in the list whereas in the array we cannot insert element anywhere in the list because it is in the contiguous memory. In the circular linked list the previous element stores the address of the next element and the last element stores the address of the starting element.