# Circular Linked List As we know that a Simple linked list is a sequential collection of Nodes, and each node has a data value and a pointer variable which hold the address of the next node.  A Circular linked list is similar to Simple linked-list the only difference is, here the pointer variable of the last node point to the head node of the linked list, Rather than Null. When the Last Node’s pointer variable point to the Head node it forms a circular structure, that’s why we call it circular linked list. The interesting thing about Circular linked-list, we can form it using the Simple and Doubly linked list, all we have to do, point the pointer of the last node to the first node instead of Null.

### Operations on Circular Linked List

Like a Simple and Doubly linked list, we can perform basic operations on Circular linked list and these operations are.

• Insertion
• Deletion
• Travers

#### Insertion

In insertion we can insert new elements in the Circular linked list, here we have to perform some extra work when we want to insert an element at the end of a linked list. In Circular linked list the insertion operation for Insert element at the beginning, middle and end, have some different operations structure.

#### Deletion

In deletion, we simply manipulate the pointer, value so instead of pointing the next element it points the element next to the next pointer.

#### Traverse

While traversing in a Circular linked list we need to set the base condition, or else we would traverse through it infinitely.

Here are some Advantages and Disadvantages of Circular Linked List:

• It simply a Circular structure so, any point on a circle could be a starting point, we can traverse the complete list starting from any point.
• It often comes in use when we are implementing advanced data structures.
• With a single node, we can visit any node.

• If there is no base condition to terminate the circular linked list once the traverse is complete, we can be thrown to an infinite loop.
• It is not easy to reverse the linked list.

### Circular linked List Implementation

```class Node:
def __init__(self,data):
self.data = data
self.next = None
def __init__(self):
self.tail = Node(None)
def append_list(self,data):
newNode = Node(data)
if self.head.data is None:
self.tail = newNode
else:
self.tail.next = newNode
self.tail = newNode
def show(self):
if self.head is None:
print("List is empty")
return
else:
print("Nodes of the circular linked list: ")
print(current.data)