{"id":81053,"date":"2021-06-22T09:00:40","date_gmt":"2021-06-22T03:30:40","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=81053"},"modified":"2021-06-22T09:00:40","modified_gmt":"2021-06-22T03:30:40","slug":"circular-linked-list","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/circular-linked-list\/","title":{"rendered":"Circular Linked List in Data Structure"},"content":{"rendered":"<p>So far, we have seen that there are mainly three types of linked lists:<\/p>\n<p>1. Singly-linked list<\/p>\n<p>2. Doubly linked list<\/p>\n<p>3. Circular linked list<\/p>\n<p>A circular linked list is a variation of a simple linked list. A circular linked list could be:<\/p>\n<p>1. Singly circular linked list<\/p>\n<p>2. Doubly circular linked list<\/p>\n<h3>What is a Circular Linked list?<\/h3>\n<p>A circular list is a list that does not contain any pointer pointing to NULL. In a circular linked list, all the nodes are inter-connected in a cyclic manner. Both singly and doubly linked lists can be circular.<\/p>\n<h4>1. Singly Circular Linked List<\/h4>\n<p>There is only one pointer in a singly linked list that points to NULL, i.e. the pointer from the last node of the list. If we want to make the singly linked list circular, we need to make the \u2018Next\u2019 pointer of the last node point to the first node.<\/p>\n<p>The following list is a singly circular linked list:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-81191\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image1.jpg\" alt=\"Singly Circular linked list\" width=\"1200\" height=\"400\" \/><\/a><\/p>\n<h4>2. Doubly Circular Linked List<\/h4>\n<p>A doubly linked list points to not only the next node but to the previous node as well. A circular doubly linked list contains 2 NULL pointers. The \u2018Next\u2019 of the last node points to the first node in a doubly-linked list.\u00a0The \u2018Prev\u2019 of the first node points to the last node.<\/p>\n<p>A doubly circular linked list looks as follows:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-81192\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image2.jpg\" alt=\"Doubly Circular linked list\" width=\"1200\" height=\"400\" \/><\/a><\/p>\n<h3>Memory Representation of Circular Linked List<\/h3>\n<p>Memory representation defines how a linked list is stored in the main memory.<\/p>\n<h4>1. Singly Circular Linked List<\/h4>\n<p>A singly circular list consists of only one addition pointer named \u2018Next\u2019. The \u2018Next\u2019 of each node, except the last node will contain the address of the upcoming node.\u00a0The last node\u2019s \u2018Next\u2019 will store the address of the first node.<\/p>\n<p>For a singly linked list, the memory will be represented as follows:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-81193\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image3.jpg\" alt=\"Memory Representation of Singly Circular linked list\" width=\"850\" height=\"850\" \/><\/a><\/p>\n<h4>2. Doubly Circular Linked List<\/h4>\n<p>In a doubly-linked list, there are two additional pointers: \u2018Next\u2019 and \u2018Prev\u2019.\u00a0The \u2018Next\u2019 of each node links to the address of the upcoming node\u2019s \u2018Prev\u2019. The \u2018Next\u2019 of the last node links to the first node.\u00a0The \u2018prev\u2019 of each node has the address of the previous node. The \u2018Prev\u2019 of the first node links to the last node.<\/p>\n<p>The memory representation diagram for the doubly linked list is:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image4.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-81194\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image4.jpg\" alt=\"Memory Representation of Circular linked list\" width=\"850\" height=\"850\" \/><\/a><\/p>\n<h3>Applications of Circular Linked List<\/h3>\n<p>A circular linked list has some real-life applications such as:<\/p>\n<p>1. In multi-player games, all the players are kept\/arranged in a circular linked list form. This gives a fixed turn number to every player.<\/p>\n<p>2. Circular linked lists are implied in our computer\u2019s operating system for scheduling various processes. In many cases, a lot of processes are aligned and they need to use the same resource. In such cases, they are put into a circular linked list and given a fixed time slot for execution.<\/p>\n<p>3. We can also implement a circular queue using a circular linked list. This will help to reduce the number of pointers from 2 to 1 because a circular linked list will require only one pointer.<\/p>\n<h3>Basic operations on a Circular Linked List:<\/h3>\n<h4>1. Traversal Operation:<\/h4>\n<p>The traversal operation includes traveling through all the nodes of the linked list and displaying their values if needed.<\/p>\n<p>The function for traversal operation in a circular linked list is as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Traversal()\n{\n   if (Head == NULL)\n       return;\n   else\n   {\n       Ptr = Head;\n       while(Ptr-&gt;Next != Head)\n       {\n           Ptr = Ptr-&gt;Next;\n           print(data);\n       }\n   }\n}\n<\/pre>\n<h4>2. Display Operation:<\/h4>\n<p>Display operation is used to print the value of all the nodes. To display a list, we need to traverse all its nodes and print their values.<\/p>\n<p>The following function depicts the display operation in a circular linked list.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Display_listl()\n{\n   if (Head == NULL)\n       return;\n   else\n   {\n       Ptr = Head;\n       while(Ptr-&gt;Next != Head)\n       {\n           Ptr = Ptr-&gt;Next;\n           display(data);\n       }\n   }\n}\n<\/pre>\n<h4>3. Insertion Operation:<\/h4>\n<p>Insertion operation is used to insert nodes in a linked list. Let us see two different cases for insertion:<\/p>\n<h5>a. Insertion at the beginning:<\/h5>\n<p>Since a circular list could be both a singly circular list and a doubly circular linked list, let us check the insertion operation for both of them.<\/p>\n<p><strong>i. Singly circular linked list:<\/strong><\/p>\n<p>We will insert a node at the front of the list in the following way:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image5.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-81195\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image5.jpg\" alt=\"Singly circular linked list\" width=\"1200\" height=\"450\" \/><\/a><\/p>\n<p>The above diagram shows that initially, the list was A\u2192B\u2192C\u2192D.<\/p>\n<p>After inserting a new node, the final list is E\u2192A\u2192B\u2192C\u2192D.<\/p>\n<p>The function for performing this operation is as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Insert_at_beginning_Singly(struct Node* Head, int key)\n{\n    Ptr = (struct Node *) malloc(sizeof(struct Node));  \/\/Allocating memory for new Node\n    if(Head == NULL)  \/\/When the list is empty\n    {  \n        Head = Ptr;  \n        Ptr-&gt;Next = Head;  \n    }  \n    temp = Head;  \n    while(temp-&gt;next != head)  \n        temp = temp-&gt;next;    \n    temp-&gt;Next = Ptr;  \/\/Making the last node point to the first node \n    Ptr-&gt;Next = Head;\n    Head = Ptr; \n}\n<\/pre>\n<p><strong>ii. Doubly circular linked list:<\/strong><\/p>\n<p>1. Insertion operation will lead to the shifting of various pointers in the list.<\/p>\n<p>2. We insert a node at the beginning such that the next pointer points to the node which was at first before.<\/p>\n<p>3. Let us take an example:<br \/>\nInitially, let the list be A\u2192B\u2192C\u2192D.<\/p>\n<p>Let us try inerting M into the list as shown:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image6.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-81196\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image6.jpg\" alt=\"Inserting in Doubly circular linked list\" width=\"1200\" height=\"500\" \/><\/a><\/p>\n<p>Thus, the new list will be M\u2192A\u2192B\u2192C\u2192D.<\/p>\n<p>The function for the above operation is:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Insert_at_beginning_Doubly(struct Node* Head, int key)\n{\n    Ptr = (struct Node *) malloc(sizeof(struct Node));  \/\/Allocating memory for new Node\n    if(Head == NULL)  \/\/When the list is empty\n    {  \n        Head = Ptr;  \n        Ptr-&gt;Next = Head;   \n        Ptr-&gt;Prev = Head;     \n    }  \n    temp = Head;   \n    while(temp-&gt;Next != Head)  \n        temp = temp-&gt;Next;   \n    temp-&gt;Next = Ptr;  \n    Ptr-&gt;Prev = temp;  \n    Head -&gt; Prev = Ptr;  \n    Ptr-&gt;Next = Head;  \n    Head = Ptr;  \n}\n<\/pre>\n<h5>b. Insertion at the end:<\/h5>\n<p>This operation will add a node at the end of the circular linked list.<\/p>\n<p><strong>i. Singly linked list:<\/strong><\/p>\n<p>a. To insert a node at the end of the list, we first need to traverse the whole list.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image7-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-81204\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image7-1.jpg\" alt=\"Circular linked list\" width=\"1200\" height=\"450\" \/><\/a><\/p>\n<p>b. The function for insertion at the end is:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Insert_at_end_singly(struct Node* Head, int key)\n{\n    Ptr = (struct Node *) malloc(sizeof(struct Node));  \/\/Allocating memory for new Node\n    if(Head == NULL)  \/\/When the list is empty\n    {  \n        Head = Ptr;  \n        Ptr-&gt;Next = Head;   \n    }  \n    temp = Head;   \n    while(temp-&gt;Next != Head)  \n        temp = temp-&gt;Next;   \n    temp-&gt;Next = Ptr;  \n    Ptr-&gt;Next = Head;  \n}\n<\/pre>\n<p><strong>ii. Doubly linked list:<\/strong><\/p>\n<p>a. If the list is empty, we will insert a node after the Head.<\/p>\n<p>b. If the list is not empty, we first need to traverse the whole list to insert a node at the end of the list.<\/p>\n<p>Suppose we wish to insert the node \u2018M\u2019 at the end of the list, the list then will be A\u2192B\u2192C\u2192D\u2192M as shown:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image8.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-81199\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image8.jpg\" alt=\"Insert node at end in Doubly Circular Linked List\" width=\"1200\" height=\"500\" \/><\/a><\/p>\n<p>The function will be:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Insert_at_end_doubly(struct Node* Head, int key)\n{\n    Ptr = (struct Node *) malloc(sizeof(struct Node));  \/\/Allocating memory for new Node\n    if(Head == NULL)  \/\/When the list is empty\n    {  \n        Head = Ptr;  \n        Ptr-&gt;Next = Head; \n        Ptr-&gt;Prev = Head;\n    }  \n    Head-&gt;Prev = Ptr;  \n    Ptr-&gt;Next = Head;  \n    temp-&gt;Next = Ptr;  \n    Ptr-&gt;Prev = temp; \n}\n<\/pre>\n<h4>4. Deletion from the beginning:<\/h4>\n<h5>a. Singly linked list:<\/h5>\n<p>a. It involves deleting the first node from the linked list.<\/p>\n<p>b. Suppose we have a list A\u2192B\u2192C\u2192D and we wish to delete D from it, we will do it as follows:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image9.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-81200\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image9.jpg\" alt=\"Delete first node in circular linked list\" width=\"1200\" height=\"400\" \/><\/a><\/p>\n<p>The function for the deletion operation will be:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Delete_from_brginning_sngly(struct Node* Head)\n{\n    Ptr = (struct Node *) malloc(sizeof(struct Node));  \/\/Allocating memory for new Node\n    if(Head == NULL)  \/\/When the list is empty\n        return;\n    if(Head-&gt;Next == Head)  \/\/When the list contains a single node\n    {  \n        Head = NULL;  \n        free(Head);  \n    }  \n    Ptr = Head;   \n    while(Ptr-&gt;Next != Head)  \n        Ptr = Ptr-&gt;Next;   \n    Ptr-&gt;Next = Head-&gt;Next;\n    free(Head);\n}\n<\/pre>\n<p>While writing its function, we take into consideration three different cases:<\/p>\n<p>1. When the list is empty<\/p>\n<p>2. When the list has only one node<\/p>\n<p>3. When the list has two or more nodes<\/p>\n<h5>b. Doubly linked list:<\/h5>\n<p>1. If we wish to delete the first node from a doubly-linked list, we need to make the Head point to the second node.<\/p>\n<p>2. Suppose we have a doubly-linked list: A\u2192B\u2192C\u2192D.<\/p>\n<p>3. On deleting the first node, we will get B\u2192C\u2192D.<\/p>\n<p>4. The pointer adjustments are shown below:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image10.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-81201\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image10.jpg\" alt=\"Delete first node in doubly circular linked list\" width=\"1200\" height=\"400\" \/><\/a><\/p>\n<p>The pseudo-code for deleting operation will be:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Deletion_from_beginning_doubly(int key){\n    \n    if (Head == NULL)   \/\/If the list is empty\n    {\n        free(Head);\n        return;\n    }\n    temp = head;   \n    while(temp-&gt;Next != head)  \n        temp = temp-&gt;Next;  \n    temp-&gt;Next = Head-&gt;Next;   \/\/Make temp point to the last node of the list\n    Head-&gt;Next-&gt;Prev = temp;  \/\/the new Head must also point to the last node\n    free(Head);   \n    Head = temp-&gt;Next;  \/\/Make the pointer next to Head as the new Head\n}\n<\/pre>\n<h5>a. Deletion at the End<\/h5>\n<p>1. It involves deleting the last node of the circular linked list.<\/p>\n<p>2. But, a circular linked list has all the nodes inter-connected to each other, so technically there is no last node.<\/p>\n<p>3. If we want to delete the last node, we will check out which node\u2019s \u2018Next\u2019 points to the first node and we will delete that node.<\/p>\n<p><strong>i. Singly-linked list<\/strong><\/p>\n<p>While deleting the last node, we take into consideration three cases:<\/p>\n<p>a. When the list is empty<\/p>\n<p>b. When the list contains a single node<\/p>\n<p>c. When the list contains two or more nodes<\/p>\n<p>Suppose we have a list A\u2192B\u2192C\u2192D. On deleting the last node, we get A\u2192B\u2192C as shown below:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image11.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-81202\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image11.jpg\" alt=\"Circular linked list\" width=\"1200\" height=\"400\" \/><\/a><\/p>\n<p>The pseudo-code will be:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Deletion_at_end_singly(int key){\n    if (Head == NULL)   \/\/If the list is empty\n        return;\n    if(Head-&gt;Next == Head)  \n    {  \n        Head = NULL;  \n        free(Head);  \/\/When the list contains only one node\n    }  \n    Ptr = Head;  \n    while(Ptr-&gt;Next != Head)  \n    {  \n        Ptr-&gt;Prev = Ptr;  \n        Ptr = Ntr-&gt;Next;  \n    }\n    Ptr-&gt;Prev-&gt;Next = Ptr-&gt;Next;  \n    free(Ptr);  \n}\n<\/pre>\n<p><strong>ii. Doubly linked list<\/strong><\/p>\n<p>a. If the list is empty, we will directly pass the return statement in the function.<\/p>\n<p>b. If the list contains a single node, we just need to make the Head point towards NULL.<\/p>\n<p>c. If the list has two or more nodes, we need to traverse the whole node and then delete the last node.<\/p>\n<p>The deletion at the end of a doubly circular linked list is shown by the following example:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image12.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-81203\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/06\/Circular-linked-list-normal-image12.jpg\" alt=\"Delete last node in doubly circular linked list\" width=\"1200\" height=\"350\" \/><\/a><\/p>\n<p>The pseudo-code for this operation will be:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Deletion_at_end_doubly(int key){\n    struct Node *Ptr = Head;\n    if (Head == NULL)   \/\/If the list is empty\n        return;\n    if(Ptr-&gt;Next == Head)  \n    {  \n        Head = NULL;  \n        free(Head);     \/\/When the list contains only one node\n        return;\n    }  \n    temp = head;   \n    while(temp-&gt;Next != Head)  \n        temp = temp-&gt;Next; \n    temp-&gt;Prev-&gt;Next = Head;  \n    Head-&gt;Prev = Ptr-&gt;Prev;    \n    free(Head);  \n}\n<\/pre>\n<h3>Advantages of a Circular Linked List<\/h3>\n<p>1. Since the list is circular, any node could be the starting point while traversal or some other operations.<\/p>\n<p>2. We can traverse to any node while standing at a particular node. We didn\u2019t have this privilege in a linear list as we could not go back to the previous nodes.<\/p>\n<p>3. The circular linked list helps in the implementation of the queue. If we implement the queue using a circular linked list, we need not maintain two pointers for front and rear. Rather we can fulfill our purpose using a single pointer.<\/p>\n<p>4. Circular doubly linked lists help in implementing advanced data structures like a Fibonacci heap.<\/p>\n<p>5. Circular linked lists are used in various CPU scheduling algorithms such as the Round Robin scheduling algorithm. In this algorithm, processes are linked up in a circular manner with fixed time slots.<\/p>\n<h3>Disadvantages of a Circular Linked List<\/h3>\n<p>1. It is very difficult to reverse a circular linked list.<\/p>\n<p>2. Finding the end of the list is very hard.<\/p>\n<p>3. If not implemented rightly, there is a high possibility of an infinite loop.<\/p>\n<h3>Conclusion<\/h3>\n<p>In this article, we studied the third type of list i.e. circular linked list. We performed various standard operations on the circular linked lists such as traversal, insertion, and deletion. We took into consideration both singly and doubly circular linked lists.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So far, we have seen that there are mainly three types of linked lists: 1. Singly-linked list 2. Doubly linked list 3. Circular linked list A circular linked list is a variation of a&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":81190,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3555],"tags":[3620,3621,3622,3623],"class_list":["post-81053","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-structure","tag-circular-linked-list","tag-circular-linked-list-in-data-structure","tag-doubly-circular-linked-list","tag-singly-circular-linked-list"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Circular Linked List in Data Structure - TechVidvan<\/title>\n<meta name=\"description\" content=\"Learn about circular Linked List, Basic operations on Singly and Doubly circular Linked List, Time complexity and its Memory Representation.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/circular-linked-list\/\" \/>\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 - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Learn about circular Linked List, Basic operations on Singly and Doubly circular Linked List, Time complexity and its Memory Representation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/circular-linked-list\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-06-22T03:30:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Circular-linked-list-in-DS-2.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=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Circular Linked List in Data Structure - TechVidvan","description":"Learn about circular Linked List, Basic operations on Singly and Doubly circular Linked List, Time complexity and its Memory Representation.","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:\/\/techvidvan.com\/tutorials\/circular-linked-list\/","og_locale":"en_US","og_type":"article","og_title":"Circular Linked List in Data Structure - TechVidvan","og_description":"Learn about circular Linked List, Basic operations on Singly and Doubly circular Linked List, Time complexity and its Memory Representation.","og_url":"https:\/\/techvidvan.com\/tutorials\/circular-linked-list\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2021-06-22T03:30:40+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Circular-linked-list-in-DS-2.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/circular-linked-list\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/circular-linked-list\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Circular Linked List in Data Structure","datePublished":"2021-06-22T03:30:40+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/circular-linked-list\/"},"wordCount":1475,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/circular-linked-list\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Circular-linked-list-in-DS-2.jpg","keywords":["Circular Linked List","Circular Linked List in data structure","Doubly Circular Linked List","Singly Circular Linked List"],"articleSection":["Data Structure Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/circular-linked-list\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/circular-linked-list\/","url":"https:\/\/techvidvan.com\/tutorials\/circular-linked-list\/","name":"Circular Linked List in Data Structure - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/circular-linked-list\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/circular-linked-list\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Circular-linked-list-in-DS-2.jpg","datePublished":"2021-06-22T03:30:40+00:00","description":"Learn about circular Linked List, Basic operations on Singly and Doubly circular Linked List, Time complexity and its Memory Representation.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/circular-linked-list\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/circular-linked-list\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/circular-linked-list\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Circular-linked-list-in-DS-2.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Circular-linked-list-in-DS-2.jpg","width":1200,"height":628,"caption":"Circular linked list in DS"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/circular-linked-list\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Circular Linked List in Data Structure"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/81053","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=81053"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/81053\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/81190"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=81053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=81053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=81053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}