

{"id":95296,"date":"2021-05-28T09:00:49","date_gmt":"2021-05-28T03:30:49","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=95296"},"modified":"2021-05-16T11:12:11","modified_gmt":"2021-05-16T05:42:11","slug":"circular-linked-list-in-data-structure","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/circular-linked-list-in-data-structure\/","title":{"rendered":"Circular Linked List in Data Structure"},"content":{"rendered":"<p>In previous articles, singly-linked lists and doubly-linked lists are explained in detail. Here we will be focusing on the circular linked list and its modified versions. Circular linked lists are a modified version of singly-linked lists.<\/p>\n<p>We know that in singly-linked lists the last node points to NULL. But in a circular linked list, the last node points to its first node forming a circular loop. In this article, we will learn about circular linked lists and doubly circular linked lists.<\/p>\n<h3>Circular Linked List<\/h3>\n<p>A circular linked list is a more efficient version of a singly linked list where the last node points to the first node instead of NULL. Just like a singly linked list, here also each node has two parts.<\/p>\n<p>The first part contains data and the second part points to the next node. It contains the address of the next node in the actual memory.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image01.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-95456\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image01.jpg\" alt=\"Circular linked list\" width=\"1200\" height=\"400\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image01.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image01-300x100.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image01-1024x341.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image01-150x50.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image01-768x256.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image01-720x240.jpg 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image01-520x173.jpg 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image01-320x107.jpg 320w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<h3>Memory Representation of Circular Linked List<\/h3>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<td><b>Data<\/b><\/td>\n<td><b>Next<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">1<\/span><\/td>\n<td><span style=\"font-weight: 400;\">DATA<\/span><\/td>\n<td><span style=\"font-weight: 400;\">4<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">2<\/span><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">3<\/span><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">4<\/span><\/td>\n<td><span style=\"font-weight: 400;\">FLAIR<\/span><\/td>\n<td><span style=\"font-weight: 400;\">6<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">5<\/span><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">6<\/span><\/td>\n<td><span style=\"font-weight: 400;\">DS<\/span><\/td>\n<td><span style=\"font-weight: 400;\">7<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">7<\/span><\/td>\n<td><span style=\"font-weight: 400;\">CLL<\/span><\/td>\n<td><span style=\"font-weight: 400;\">1<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Operations on Circular Linked List<\/h3>\n<ul>\n<li style=\"font-weight: 400;\"><b>Insert:<\/b><span style=\"font-weight: 400;\"> inserting a new node into a circular linked list.<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>Delete<\/b><span style=\"font-weight: 400;\">: deleting a node from a circular linked list.<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>Search:<\/b><span style=\"font-weight: 400;\"> finding a node in a circular linked list.<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>Display:<\/b><span style=\"font-weight: 400;\"> displaying the circular linked list.<\/span><\/li>\n<\/ul>\n<h3>Insert Node in Circular Linked List<\/h3>\n<h4>1. Insert Node at the beginning of Circular Linked List<\/h4>\n<p><span style=\"font-weight: 400;\">For Adding node at the beginning of the list, Unlink the last and first node and point the last node to the new node. Now point the new node to the head node and make the new node the new head.<\/span><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image02.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-95457\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image02.jpg\" alt=\"Insert node at start of circular linked list\" width=\"1200\" height=\"450\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image02.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image02-300x113.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image02-1024x384.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image02-150x56.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image02-768x288.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image02-720x270.jpg 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image02-520x195.jpg 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image02-320x120.jpg 320w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">void insertAtFirst(node *new)\r\n{ \r\ntemp = head;  \r\n            while(temp-&gt;next != head)  \r\n                temp = temp-&gt;next;  \r\n            new-&gt;next = head;   \r\n            temp -&gt; next =new;   \r\n            head =new;  \r\n        }<\/pre>\n<p><b>2. Insert node at the end of Circular Linked List<\/b><\/p>\n<p><span style=\"font-weight: 400;\">For adding a node at the end of the list, unlink the last and first node and point the last node to the new node. Now point new node to head node.<\/span><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image03.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-95458\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image03.jpg\" alt=\"Insert node at end of circular linked list\" width=\"1200\" height=\"450\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image03.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image03-300x113.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image03-1024x384.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image03-150x56.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image03-768x288.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image03-720x270.jpg 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image03-520x195.jpg 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image03-320x120.jpg 320w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">void insertAtLAst(Node *new)\r\n{\r\ntemp = head;  \r\n            while(temp -&gt; next != head)  \r\n                      temp = temp -&gt; next;  \r\n            temp -&gt; next = new;   \r\n            new -&gt; next = head;  \r\n        }<\/pre>\n<h3>Delete Nodes in Circular Linked List<\/h3>\n<h4>1. Deleting node at the start of Circular Linked List<\/h4>\n<p><span style=\"font-weight: 400;\">Delete an existing node from the first position in the list. Point the head to the second node.<\/span><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image04.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-95460\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image04.jpg\" alt=\"Delete First Node in Circular Linked List\" width=\"1200\" height=\"400\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image04.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image04-300x100.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image04-1024x341.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image04-150x50.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image04-768x256.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image04-720x240.jpg 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image04-520x173.jpg 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image04-320x107.jpg 320w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">void deleteAtFirst()\r\n{\r\nptr = head;   \r\n        while(ptr -&gt; next != head)  \r\n            ptr = ptr -&gt; next;   \r\n        ptr-&gt;next = head-&gt;next;  \r\n        free(head);  \r\n        head = ptr-&gt;next;  \r\n}<\/pre>\n<p><b>2. Delete node at the last of Circular Linked List<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Delete an existing node from the last position of the list. Unlink last node to head and point second last node to head node.<\/span><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image05.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-95459\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image05.jpg\" alt=\"Delet node in circular linked list\" width=\"1200\" height=\"400\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image05.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image05-300x100.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image05-1024x341.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image05-150x50.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image05-768x256.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image05-720x240.jpg 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image05-520x173.jpg 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image05-320x107.jpg 320w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">void deleteAtLast()\r\n{ \r\nptr = head;  \r\n        while(ptr -&gt;next != head)  \r\n        {  \r\n            ptr1=ptr;  \r\n            ptr = ptr-&gt;next;  \r\n        }  \r\n        ptr1-&gt;next = ptr -&gt; next;  \r\n        free(ptr);\r\n}<\/pre>\n<h3>Display Circular Linked List<\/h3>\n<p><span style=\"font-weight: 400;\">Traverse through the circular linked list starting from the head and print the data in each node.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">void DisplayList() \r\n{\r\n \r\n   struct node *disp = head;\r\n   \t\r\n    if(head != NULL) \r\n      {\r\n    \r\n      while(disp -&gt; next != disp) \r\n{     \r\n         printf(\"(%d, ) \",disp -&gt; data);\r\n         disp = disp -&gt; next;\r\n      }\r\n   }\r\n}<\/pre>\n<h3>Doubly Circular Linked List<\/h3>\n<p>A doubly circular linked list is a more efficient version of a Doubly linked list. Here, the next pointer of the last node points to the first node, and the previous pointer of the first node points to the last node.<\/p>\n<p>Just like a doubly-linked list, here also each node has three parts. One part contains data and the other parts point to the next node and the previous node.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image06.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-95461\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image06.jpg\" alt=\"Doubly Circular linked list\" width=\"1200\" height=\"400\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image06.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image06-300x100.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image06-1024x341.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image06-150x50.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image06-768x256.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image06-720x240.jpg 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image06-520x173.jpg 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image06-320x107.jpg 320w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<h3>Memory Representation of Doubly Circular Linked List<\/h3>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<td><b>Previous<\/b><\/td>\n<td><b>Data<\/b><\/td>\n<td><b>Next<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">1<\/span><\/td>\n<td><span style=\"font-weight: 400;\">7<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Doubly<\/span><\/td>\n<td><span style=\"font-weight: 400;\">3<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">2<\/span><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">3<\/span><\/td>\n<td><span style=\"font-weight: 400;\">1<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Data<\/span><\/td>\n<td><span style=\"font-weight: 400;\">4<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">4<\/span><\/td>\n<td><span style=\"font-weight: 400;\">3<\/span><\/td>\n<td><span style=\"font-weight: 400;\">FLAIR<\/span><\/td>\n<td><span style=\"font-weight: 400;\">6<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">5<\/span><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">6<\/span><\/td>\n<td><span style=\"font-weight: 400;\">4<\/span><\/td>\n<td><span style=\"font-weight: 400;\">DS<\/span><\/td>\n<td><span style=\"font-weight: 400;\">7<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">7<\/span><\/td>\n<td><span style=\"font-weight: 400;\">6<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Stack<\/span><\/td>\n<td><span style=\"font-weight: 400;\">1<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Operations on doubly circular linked list<\/h3>\n<ul>\n<li style=\"font-weight: 400;\"><b>Insert:<\/b><span style=\"font-weight: 400;\"> adding a new node to the existing doubly circular linked list.<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>Delete<\/b><span style=\"font-weight: 400;\">: removing a node from the existing doubly circular linked list.<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>Search:<\/b><span style=\"font-weight: 400;\"> finding\u00a0 a node in the existing doubly circular linked list.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>Display:<\/b><span style=\"font-weight: 400;\"> display the existing doubly circular linked list.<\/span><\/li>\n<\/ul>\n<h3>Inserting Nodes in Doubly Circular Linked List<\/h3>\n<h4>1. Insert node at the beginning of Doubly Circular Linked List<\/h4>\n<p><span style=\"font-weight: 400;\">Adding a node at the beginning of the list is done by pointing the new node to the first and the last node and set it as the new head.<\/span><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image07.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-95462\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image07.jpg\" alt=\"Insert node at start of doubly circular linked list\" width=\"1200\" height=\"500\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image07.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image07-300x125.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image07-1024x427.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image07-150x63.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image07-768x320.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image07-720x300.jpg 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image07-520x217.jpg 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image07-320x133.jpg 320w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">void insertAtFirst(node *new)\r\n{ \r\ntemp = head;  \r\n            while(temp-&gt;next != head)  \r\n                temp = temp-&gt;next;  \r\n            new-&gt;next = head;  \r\n            head -&gt; previous = new; \r\n            temp -&gt; next =new;   \r\n            new -&gt; previous = temp;\r\n            head =new;  \r\n        }<\/pre>\n<h4>2. Insert node at the end of Doubly Circular Linked List<\/h4>\n<p><span style=\"font-weight: 400;\">Adding a node at the end of the list is done by pointing the new node to the first and the last node.<\/span><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image08.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-95463\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image08.jpg\" alt=\"insert node at end of doubly circular linked list\" width=\"1200\" height=\"500\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image08.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image08-300x125.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image08-1024x427.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image08-150x63.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image08-768x320.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image08-720x300.jpg 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image08-520x217.jpg 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image08-320x133.jpg 320w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">void insertAtLast(Node *new)\r\n{\r\ntemp = head;  \r\n            while(temp -&gt; next != head)  \r\n                      temp = temp -&gt; next;  \r\n            new-&gt;next = head;  \r\n            head -&gt; previous = new; \r\n            temp -&gt; next =new;   \r\n            new -&gt; previous = temp;\r\n        }<\/pre>\n<h3>Deleting Nodes in the Doubly Circular Linked List<\/h3>\n<p><b>1. Deleting node at the start of Doubly Circular Linked List<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Delete an existing node from the first position in the list.<\/span><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image09.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-95464\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image09.jpg\" alt=\"Delete node in doubly circular linked list\" width=\"1200\" height=\"400\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image09.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image09-300x100.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image09-1024x341.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image09-150x50.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image09-768x256.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image09-720x240.jpg 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image09-520x173.jpg 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image09-320x107.jpg 320w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">void deleteAtFirst()\r\n{\r\nptr = head;   \r\n        while(ptr -&gt; next != head)  \r\n            ptr = ptr -&gt; next;   \r\n        ptr-&gt;next = head-&gt;next;  \r\n        free(head);  \r\n        head = ptr-&gt;next;  \r\n        head.previous -&gt; ptr;\r\n}<\/pre>\n<p><b>2. Delete node at last of Doubly Circular Linked List<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Delete an existing node from the last position of the list. Unlink first and last node. Point second last node to the first node.<\/span><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image10.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-95465\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image10.jpg\" alt=\"Delete last node in doubly circular linked list\" width=\"1200\" height=\"350\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image10.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image10-300x88.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image10-1024x299.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image10-150x44.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image10-768x224.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image10-720x210.jpg 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image10-520x152.jpg 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-normal-image10-320x93.jpg 320w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">void deleteAtLast()\r\n{ \r\nptr = head;  \r\n        while(ptr -&gt;next != head)  \r\n        {  \r\n            ptr1=ptr;  \r\n            ptr = ptr-&gt;next;  \r\n        }  \r\n        ptr1-&gt;next = ptr -&gt; next;  \r\n        free(ptr);\r\n        head -&gt; previous = ptr ;\r\n}<\/pre>\n<h3>Display Doubly Circular Linked List<\/h3>\n<p><span style=\"font-weight: 400;\">Traverse through the circular linked list starting from the head and print the data in each node.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">void DisplayList() \r\n{\r\n \r\n   struct node *disp = head;\r\n   \t\r\n    if(head != NULL) \r\n      {\r\n    \r\n      while(disp -&gt; next != disp) \r\n{     \r\n         printf(\"(%d, ) \",disp -&gt; data);\r\n         disp = disp -&gt; next;\r\n      }\r\n   }\r\n}<\/pre>\n<h3>Search for a node in a doubly circular linked list<\/h3>\n<p>Traverse through the circular linked list starting from the head and compare data in each node with the search element. If found, return the location at which the element was found. If not found, return -1.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int SearchElement(int se) \r\n{\r\n  node *search = head;\r\n  while(search != NULL &amp;&amp; search -&gt; data != se) \r\n{  \r\n    search = search -&gt; next;\r\n  }\r\n  return search;\r\n}<\/pre>\n<h3>Circular Linked list implementation in C<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\r\n#include &lt;stdlib.h&gt;\r\n  \r\nstruct Node\r\n {\r\n    int data;\r\n    struct Node* next;\r\n};\r\n  \r\nint main()\r\n{\r\n    struct Node* Node1 = NULL;\r\n    struct Node* Node2 = NULL;\r\n    struct Node* Node3 = NULL;\r\n    struct Node* head = Node1;\r\n  \r\n    \r\n   Node1 = (struct Node*)malloc(sizeof(struct Node));\r\n   Node2 = (struct Node*)malloc(sizeof(struct Node));\r\n   Node3 = (struct Node*)malloc(sizeof(struct Node));\r\n  \r\n     \r\n    Node1 -&gt; data = 1; \r\n    Node1 -&gt; next = Node2;   \r\n       \r\n    Node2 -&gt; data = 2;\r\n    Node2 -&gt; next = Node3;\r\n  \r\n     \r\n    Node3 -&gt; data = 3; \r\n    Node3 -&gt; next = Node1;\r\n  \r\n    display(Node1);\r\n    return 0;\r\n}\r\n\r\nvoid display(struct Node* disp)\r\n{\r\n    do\r\n{\r\n        printf(\" %d \", disp -&gt; data);\r\n        disp = disp -&gt; next;\r\n    }while (disp != head) ;\r\n}<\/pre>\n<h3>Circular Linked list implementation in Python<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class Node:\r\n    def __init__(self, data):\r\n        self.data = data  \r\n        self.next = None  \r\n  \r\nclass SinglyLinkedList:    \r\n    def __init__(self):\r\n        self.head = None\r\n    \r\n    def DisplayList(self):\r\n        temp = self.head\r\n        while (temp):\r\n            print (temp.data)\r\n            temp = temp.next\r\n  \r\nif __name__=='__main__':\r\n  \r\n    sll = SinglyLinkedList()\r\n  \r\n    sll.head = Node(\u201cDATA\u201d)\r\n    Node2 = Node(\u201cFLAIR\u201d)\r\n    Node3 = Node(\u201cCLL\u201d)\r\n  \r\n    sll.head.next = Node2; \r\n    Node2.next = Node3; \r\n    Node3.next = head;\r\n  \r\n    llist.DisplayList()<\/pre>\n<h3>Implementation of Circular Linked list in C++<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;bits\/stdc++.h&gt;\r\nusing namespace std;\r\n  \r\nclass Node {\r\npublic:\r\n    string data;\r\n    Node* next;\r\n};\r\n  \r\nvoid displayList(Node* n)\r\n{\r\n    while (n != NULL)\r\n {\r\n        cout &lt;&lt; n -&gt; data &lt;&lt; \" \";\r\n        n = n -&gt; next;\r\n    }\r\n}\r\n \r\nint main()\r\n{\r\n    Node* Node1 = NULL;\r\n    Node* Node2 = NULL;\r\n    Node* Node3 = NULL;\r\n  \r\n    Node1 = new Node();\r\n    Node2 = new Node();\r\n    Node3 = new Node();\r\n  \r\n    Node1 -&gt; data = \u201dDATA\u201d ; \r\n    Node1 -&gt; next = Node2; \r\n  \r\n    Node2 -&gt; data = \u201cFLAIR\u201d; \r\n    Node2 -&gt; next = Node3;\r\n  \r\n    Node3 -&gt; data = \u201cCLL\u201d; \r\n    Node3 -&gt; next = Node1;\r\n  \r\n    displayList(Node1);\r\n  \r\n    return 0;\r\n}<\/pre>\n<h3>Circular Linked list implementation in Java<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class CircularLinkedList\r\n {\r\n    \r\nNode head; \r\n \r\n    static class Node\r\n   {\r\n        String data;\r\n        Node next;\r\n        \r\n        Node(String d)\r\n        {\r\n            data = d;\r\n            next = null;\r\n        } \r\n    }\r\n  \r\n    \r\n    public void DisplayList()\r\n    {\r\n        Node n = head;\r\n        do\r\n{\r\n        System.out.print(n.data + \" \");\r\n            n = n.next;\r\n    }while (n != head) ;\r\n \r\n \r\n        \r\n    }\r\n  \r\n    public static void main(String[] args)\r\n    {\r\n        \r\n        CircularLinkedList cllist = new CircularLinkedList();\r\n   \r\n        Node Node1 = new Node(\"DATA\");\r\n        cllist.head = Node1;\r\n        Node Node2 = new Node(\"FLAIR\");\r\n        Node Node3 = new Node(\"CLL\");\r\n  \r\n        cllist.head.next = Node2; \r\n        Node2.next = Node3;\r\n        Node3.next = Node1;\r\n  \r\n        cllist.DisplayList();\r\n    }\r\n}<\/pre>\n<h3>Advantages of Circular Linked List<\/h3>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">We can consider any node as a starting point. The whole linked list is traversable from any starting point.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The time complexity for jumping from the first node to last or last to first in a doubly circular linked list is constant<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">We don\u2019t need two different pointers for moving forward and backward. We can always reach the backward node by moving forward since it is a loop.<\/span><\/li>\n<\/ul>\n<h3>Applications of Circular Linked list<\/h3>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">All applications are put in a circular list on our personal computers. The operating system gives fixed time to each process for execution. It keeps on traversing through the list until all processes are executed.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Circular linked lists are used in creating a circular queue.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">In multiplayer games like ludo king, all players are stored in a circular list and the pointer keeps on moving after each player\u2019s chance.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Doubly circular linked lists are very useful in the implementation of advanced data structures like the Fibonacci heap.<\/span><\/li>\n<\/ul>\n<h3>Conclusion<\/h3>\n<p>With this article, we end our discussion of linked lists. We now understand different types of linked lists and how to perform commonly used operations on them.<\/p>\n<p>Linked lists are basic examples of Dynamic programming. In future articles, we will learn about other Data Structures that are implemented using a linked list.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In previous articles, singly-linked lists and doubly-linked lists are explained in detail. Here we will be focusing on the circular linked list and its modified versions. Circular linked lists are a modified version of&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":95454,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24020],"tags":[24347,24345,2517,24343,24346],"class_list":["post-95296","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-structure-tutorials","tag-advantages-of-circular-linked-list","tag-applications-of-circular-linked-list","tag-circular-linked-list","tag-circular-linked-list-in-data-structure","tag-doubly-circular-linked-list"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Circular Linked List in Data Structure - DataFlair<\/title>\n<meta name=\"description\" content=\"Circular linked list is a linked list where all nodes are connected to form a circle. There is no NULL at the end. Learn more about it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/circular-linked-list-in-data-structure\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Circular Linked List in Data Structure - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Circular linked list is a linked list where all nodes are connected to form a circle. There is no NULL at the end. Learn more about it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/circular-linked-list-in-data-structure\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-28T03:30:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-in-DS-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Circular Linked List in Data Structure - DataFlair","description":"Circular linked list is a linked list where all nodes are connected to form a circle. There is no NULL at the end. Learn more about it.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/circular-linked-list-in-data-structure\/","og_locale":"en_US","og_type":"article","og_title":"Circular Linked List in Data Structure - DataFlair","og_description":"Circular linked list is a linked list where all nodes are connected to form a circle. There is no NULL at the end. Learn more about it.","og_url":"https:\/\/data-flair.training\/blogs\/circular-linked-list-in-data-structure\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2021-05-28T03:30:49+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-in-DS-1.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/circular-linked-list-in-data-structure\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/circular-linked-list-in-data-structure\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9"},"headline":"Circular Linked List in Data Structure","datePublished":"2021-05-28T03:30:49+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/circular-linked-list-in-data-structure\/"},"wordCount":983,"commentCount":1,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/circular-linked-list-in-data-structure\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-in-DS-1.jpg","keywords":["Advantages of Circular Linked list","Applications of Circular Linked list","Circular Linked List","Circular Linked List in data Structure","Doubly Circular Linked List"],"articleSection":["Data Structure Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/circular-linked-list-in-data-structure\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/circular-linked-list-in-data-structure\/","url":"https:\/\/data-flair.training\/blogs\/circular-linked-list-in-data-structure\/","name":"Circular Linked List in Data Structure - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/circular-linked-list-in-data-structure\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/circular-linked-list-in-data-structure\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-in-DS-1.jpg","datePublished":"2021-05-28T03:30:49+00:00","description":"Circular linked list is a linked list where all nodes are connected to form a circle. There is no NULL at the end. Learn more about it.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/circular-linked-list-in-data-structure\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/circular-linked-list-in-data-structure\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/circular-linked-list-in-data-structure\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-in-DS-1.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/Circular-linked-list-in-DS-1.jpg","width":1200,"height":628,"caption":"Circular linked list in Data Structure"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/circular-linked-list-in-data-structure\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Data Structure Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/data-structure-tutorials\/"},{"@type":"ListItem","position":3,"name":"Circular Linked List in Data Structure"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team is a group of passionate educators and industry experts dedicated to providing high-quality online learning resources on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. With years of experience in the field, the team aims to simplify complex topics and help learners advance their careers. At DataFlair, we believe in empowering students and professionals with the knowledge and skills needed to thrive in today\u2019s fast-paced tech industry. Follow us for Free courses, expert insights, tutorials, and practical tips to boost your learning journey.","url":"https:\/\/data-flair.training\/blogs\/author\/datafbdad\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/95296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=95296"}],"version-history":[{"count":5,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/95296\/revisions"}],"predecessor-version":[{"id":95466,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/95296\/revisions\/95466"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/95454"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=95296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=95296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=95296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}