{"id":83085,"date":"2021-08-10T09:00:08","date_gmt":"2021-08-10T03:30:08","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=83085"},"modified":"2021-08-10T09:00:08","modified_gmt":"2021-08-10T03:30:08","slug":"linked-lists-in-c","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/linked-lists-in-c\/","title":{"rendered":"Linked List in C Programming"},"content":{"rendered":"<p>From the name, you can easily say that it is used for linking lists together. But to put it in a nice way, you can say that a linked list is the sequence of linked lists which are connected with each other through links. Linked list in C is a linear data structure where the data is stored at different locations and they are linked using pointers. You have to use pointers to implement the linked list data structure.<\/p>\n<h3>What is a linked list in C?<\/h3>\n<p>A linked list can be defined as a collection of connected nodes. It is a linear data structure. A linked list contains two parts such as:-<\/p>\n<ul>\n<li><strong>Data Part:-<\/strong> Contains the data of the user.<\/li>\n<li><strong>Pointer Part:-<\/strong> It points to the next member of the linked list.<\/li>\n<\/ul>\n<p>In the above image, Head contains the address of the first node. And the last node in the linked list points to <strong>NULL.<\/strong><br \/>\nNodes are stored at different locations.<\/p>\n<h3>Types of Linked List in C:-<\/h3>\n<p>There are 3 types of linked list such as:-<\/p>\n<ul>\n<li>Singly Linked List<\/li>\n<li>Doubly Linked List<\/li>\n<li>Circular Linked List<\/li>\n<\/ul>\n<h4>Singly Linked List:-<\/h4>\n<p>Singly linked list is the most common linked list among the others. The singly linked list can be traversed only in one direction. It is a collection of ordered sets of elements. In singly linked list, Each node has a data and a pointer to the next node.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Linked-Lists-in-C-normal-image01.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83463\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Linked-Lists-in-C-normal-image01.jpg\" alt=\"Singly Linked Lists in C\" width=\"840\" height=\"255\" \/><\/a><\/p>\n<p><strong>Syntax:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">struct node{\n    int data;\n    struct node *next;\n}\n<\/pre>\n<p>Below, we have created a singly linked list of three members.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/\/ Node Initializing!\nstruct node *HEAD;\nstruct node *ONE = NULL;\nstruct node *TWO = NULL;\nstruct node *THREE = NULL;\n\n\/\/ Allocating memory!\nONE = malloc(sizeof(struct node));\nTWO = malloc(sizeof(struct node));\nTHREE = malloc(sizeof(struct node));\n\n\/\/ Assigning the values of data!\nONE-&gt;data = 23;\nTWO-&gt;data = 34;\nTHREE-&gt;data = 90;\n\n\/\/ Connecting nodes with each other!\nONE-&gt;next = TWO;\nTWO-&gt;next = THREE;\nTHREE-&gt;next = NULL;\n\n\/\/ Saving the address of first node\nHEAD = ONE;\n<\/pre>\n<h4>Doubly Linked List in C:-<\/h4>\n<p>In the doubly linked list, we add a pointer to the previous node and also to the next node. The Doubly linked list can be traversed in two directions such as forward and backward.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Linked-Lists-in-C-normal-image02.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83464\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Linked-Lists-in-C-normal-image02.jpg\" alt=\"Doubly Linked Lists in C\" width=\"1089\" height=\"255\" \/><\/a><\/p>\n<p><strong>Syntax:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">struct node {\n    int data;\n    struct node *next_node;\n    struct node *previous_node;\n}<\/pre>\n<p>Below, We created a doubly-linked list of three members.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/\/ Node Initializing!\nstruct node *HEAD;\nstruct node *ONE = NULL;\nstruct node *TWO = NULL;\nstruct node *THREE = NULL;\n\n\/\/ Allocating memory!\nONE = malloc(sizeof(struct node));\nTWO = malloc(sizeof(struct node));\nTHREE = malloc(sizeof(struct node));\n\n\/\/ Assigning the values of data!\nONE-&gt;data = 2;\nTWO-&gt;data = 4;\nTHREE-&gt;data = 9;\n\n\/\/ Connecting nodes with each other!\nONE-&gt;next_node = TWO;\nONE-&gt;previous_node = NULL;\nTWO-&gt;next_node = THREE;\nTWO-&gt;previous_node = ONE;\nTHREE-&gt;next_node = NULL;\nTHREE-&gt;previous_node = TWO;\n\n\/\/ Saving the address of first node\nHEAD = ONE;<\/pre>\n<h4>Circular Linked List in C:-<\/h4>\n<p>In a circular linked list, the last element of the list points to the first element of the list. That\u2019s why it is called a circular linked list.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Linked-Lists-in-C-normal-image03.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83465\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Linked-Lists-in-C-normal-image03.jpg\" alt=\"Circular Linked Lists in C\" width=\"1180\" height=\"255\" \/><\/a><\/p>\n<p>You can create a circular linked list with the help of a singly or doubly linked list. Below, we created a circular linked list of three members.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/\/ Node Initializing!\nstruct node *HEAD;\nstruct node *ONE = NULL;\nstruct node *TWO = NULL;\nstruct node *THREE = NULL;\n\n\/\/ Allocating memory!\nONE = malloc(sizeof(struct node));\nTWO = malloc(sizeof(struct node));\nTHREE = malloc(sizeof(struct node));\n\n\/\/ Assigning the values of data!\nONE-&gt;data = 1;\nTWO-&gt;data = 2;\nTHREE-&gt;data = 3;\n\n\/\/ Connecting nodes with each other!\nONE-&gt;next = TWO;\nTWO-&gt;next = THREE;\nTHREE-&gt;next = ONE;\n\n\/\/ Saving the address of first node\nHEAD = ONE;<\/pre>\n<h3>Reasons to use linked list over array:-<\/h3>\n<p>There are several advantages and disadvantages while using an array. But with a linked list, you can overcome the problems while using an array.<br \/>\nIf you use array in the program code then you will find these following limitations:-<\/p>\n<ul>\n<li>You have to know the size of the array before using it in the program code.<\/li>\n<li>The elements of the array are stored in contiguous memory locations.<\/li>\n<li>You cannot increase the size of the array at run time.<br \/>\nTo prevent the above limitations, you can make use of Linked List.<\/li>\n<li>In the linked list, we do not have to define the size during declaration.<\/li>\n<li>Linked list dynamically allocates the memory. It is not like an array. The nodes are stored at non-contiguous memory locations.<\/li>\n<\/ul>\n<h3>Uses of Linked List in C:-<\/h3>\n<ul>\n<li>Each and every node must have data stored into it.<\/li>\n<li>You don\u2019t have to declare the size during declaration. It is limited to memory size.<\/li>\n<li>In a singly linked list, you can store the values of primitive types or objects.<\/li>\n<\/ul>\n<h3>Complexity of Linked List:-<\/h3>\n<h4>Linked List Time Complexity:-<\/h4>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<td><b>Worst Case<\/b><\/td>\n<td><b>Average Case<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>Search<\/b><\/td>\n<td><b>O(n)<\/b><\/td>\n<td><b>O(n)<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>Insert<\/b><\/td>\n<td><b>O(1)<\/b><\/td>\n<td><b>O(1)<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>Deletion<\/b><\/td>\n<td><b>O(1)<\/b><\/td>\n<td><b>O(1)<\/b><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Linked List Space Complexity:-<\/h4>\n<p>Space Complexity of Linked List:- <strong>O(n)<\/strong><\/p>\n<h3>Performing operations on Singly Linked List:-<\/h3>\n<p>Below is a list of operations which you can perform upon a Singly Linked List.<\/p>\n<p><strong>1. Creating Nodes in Linked List<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">struct node   \n{  \nint data;   \nstruct node *next;  \n};  \nstruct node *HEAD, *point;   \npoint = (struct node *)malloc(sizeof(struct node *));<\/pre>\n<h4>2. Insertion in Linked list<\/h4>\n<p>In a Singly linked list, you can perform insertion at different locations.<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Operation<\/b><\/td>\n<td><b>What it does<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Doing insertion at the beginning of the list<\/span><\/td>\n<td><span style=\"font-weight: 400\">You can insert any element at the front of the linked list.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Inserting at the end of the linked list<\/span><\/td>\n<td><span style=\"font-weight: 400\">You can perform insertion at the last of the linked list.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Inserting after the specified node<\/span><\/td>\n<td><span style=\"font-weight: 400\">You can also insert a new node after a specified node.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>3. Deletion, Traversing and Searching in Linked List<\/h4>\n<p>In a singly linked list, you can perform deletion at different locations.<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Operation<\/b><\/td>\n<td><b>What it does<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Performing deletion at the beginning of the linked list<\/span><\/td>\n<td><span style=\"font-weight: 400\">You can delete a node at the beginning of the linked list.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Performing deletion at the end of the linked list<\/span><\/td>\n<td><span style=\"font-weight: 400\">You can perform deletion of the last node in the linked list.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Performing deletion after the specified node<\/span><\/td>\n<td><span style=\"font-weight: 400\">You can also delete a node after a specified node.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Traversing<\/span><\/td>\n<td><span style=\"font-weight: 400\">Through traversing, we visit each node of the linked list at least once to perform some operations on it.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Searching<\/span><\/td>\n<td><span style=\"font-weight: 400\">Through searching, you can match each element of the linked list with a given element.\u00a0<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>4. Iterating over a list:-<\/h4>\n<p>Below I have added a function which will print all the items on a list through iterating. First, we have to set a pointer that will keep track of the nodes which we are about to print.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">void list_printing(node_exist * HEAD) {\n    node_exist * ptr = HEAD;\n\n    while (ptr != NULL) {\n        printf(\"%d\\n\", ptr-&gt;value);\n        ptr = ptr-&gt;next;\n    }\n}<\/pre>\n<h4>5. Inserting Item at the end of the Linked list:-<\/h4>\n<p>In the above section, we learnt how to iterate over a list. You can also add an item at the end of the list.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">void add(node_exist * HEAD, int value) {\n    node_exist * ptr = HEAD;\n    while (ptr-&gt;next != NULL) {\n        ptr = ptr-&gt;next;\n    }\n\n    \/\/ adding a new variable!\n    ptr-&gt;next = (node_exist *) malloc(sizeof(node_exist));\n    ptr-&gt;next-&gt;value = value;\n    ptr-&gt;next-&gt;next = NULL;\n}<\/pre>\n<h4>6. Adding an item to the beginning of a linked list:-<\/h4>\n<p>You have to follow the below guides to add an item to the beginning of a linked list:-<\/p>\n<ul>\n<li>First, you have to create a new item and set the value of the item.<\/li>\n<li>Then, you have to point the new item to the head of the list.<\/li>\n<li>And then, you have to set the new item as the head of the list.<\/li>\n<\/ul>\n<p>We have to add a double pointer so that we can change the pointer itself.<br \/>\n<strong>Code:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">void add_to_beginning(node_exist ** HEAD, int value) {\n    node_exist * new_node_create;\n    new_node_create = (node_exist *) malloc(sizeof(node_exist));\n\n    new_node_create-&gt;value = value;\n    new_node_create-&gt;next = *HEAD;\n    *HEAD = new_node_create;\n}<\/pre>\n<h4>7. Remove the first item from the linked list:-<\/h4>\n<p>To remove the first item from a list, do the following:-<\/p>\n<ul>\n<li>First, take the next item which head points to and save it.<\/li>\n<li>Then, free the head.<\/li>\n<li>And, then you set the head item to be the next item which we have stored.<\/li>\n<\/ul>\n<p><strong>Code:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int remove_first(node_exist ** HEAD) {\n    int ret = -1;\n    node_exist * next_node = NULL;\n\n    if (*HEAD == NULL) {\n        return -1;\n    }\n\n    next_node = (*HEAD)-&gt;next;\n    ret = (*HEAD)-&gt;value;\n    free(*HEAD);\n    *HEAD = next_node;\n\n    return ret;\n}<\/pre>\n<h4>8. Remove the last item from the linked list:-<\/h4>\n<p>You can also remove the last item from a linked list. It is very similar to adding an item at the beginning of a linked list.<br \/>\n<strong>Code:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int remove_last_item(node_exist * HEAD) {\n    int ret = 0;\n    if (HEAD-&gt;next == NULL) {\n        ret = HEAD-&gt;val;\n        free(HEAD);\n        return ret;\n    }\n\n    \/\/ second last of the linked list!\n    node_exist * ptr = HEAD;\n    while (ptr-&gt;next-&gt;next != NULL) {\n        ptr = ptr-&gt;next;\n    }\n\n    \/\/ ptr pointer points to the second last of the linked list, so doing the remove!\n    ret = ptr-&gt;next-&gt;value;\n    free(ptr-&gt;next);\n    ptr-&gt;next = NULL;\n    return ret;\n}\n\n<\/pre>\n<h4>9. Popping out a specific item from the list:-<\/h4>\n<p>You have to follow the below algorithm to remove a specific item from the linked list:-<\/p>\n<ul>\n<li>First, iterate over the node before the node you want to delete.<\/li>\n<li>Then, save the node which you want to delete on a temporary pointer.<\/li>\n<li>Next, you have to set the previous node\u2019s next pointer point to the node after the node which you want to delete.<\/li>\n<li>Then, you can delete the node using the temporary pointer.<\/li>\n<\/ul>\n<p><strong>Code:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int remove_specific(node_exist ** HEAD, int a) {\n    int i = 0;\n    int ret = -1;\n    node_exist * ptr = *HEAD;\n    node_exist * temporary_node = NULL;\n\n    if (a == 0) {\n        return remove_first(HEAD);\n    }\n\n    for (i = 0; i &lt; a-1; i++) {\n        if (ptr-&gt;next == NULL) {\n            return -1;\n        }\n        ptr = ptr-&gt;next;\n    }\n\n    temporary_node = ptr-&gt;next;\n    ret = temporary_node-&gt;value;\n    ptr-&gt;next = temporary_node-&gt;next;\n    free(temporary_node);\n\n    return ret;\n\n}\n<\/pre>\n<p><strong>Example:- Performing Operations on Singly Linked List<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include&lt;stdio.h&gt;  \n#include&lt;stdlib.h&gt;  \nstruct node   \n{  \n  int data;  \n  struct node *next;   \n};  \nstruct node *HEAD;  \n \nvoid insert_at_begin();   \nvoid insert_at_last();  \nvoid insert_random();  \nvoid delete_at_begin();  \nvoid delete_at_last();  \nvoid delete_random();  \nvoid print();  \nvoid searching();  \nvoid main()  \n{  \n  int your_choice=0;  \n  while(your_choice != 9)   \n  {\n    \tprintf(\"\\n**************************************\\n\");\n    \tprintf(\"\\n\\nTechVidvan Tutorial: Performing operations on Singly Linked List!\\n\\n\");\n    \tprintf(\"Choose an option from the below list!\\n\");  \n    \tprintf(\"\\n**************************************\\n\");  \n    \tprintf(\"1.Do insertion at beginning of the list!\\n2.Do insertion at last!\\n3.Do insertion at random location!\\n4.Do deletion from the beginning of the list!\\n5.Do deletion at the last of the list!\\n6.Do deletion of a node after a specified node!\\n7.Perform a searching operation for an element!\\n8.Display!\\n9.Exit!\\n\");  \n    \tprintf(\"\\nEnter your choice?\\n\");    \t \n    \tscanf(\"\\n%d\",&amp;your_choice);  \n    \tswitch(your_choice)  \n    \t{  \n        \tcase 1:  \n        \tinsert_at_begin(); \t \n        \tbreak;  \n        \tcase 2:  \n        \tinsert_at_last();    \t \n        \tbreak;  \n        \tcase 3:  \n        \tinsert_at_last();  \t \n        \tbreak;  \n        \tcase 4:  \n        \tdelete_at_begin();  \t \n        \tbreak;  \n        \tcase 5:  \n        \tdelete_at_last();   \t \n        \tbreak;  \n        \tcase 6:  \n        \tdelete_random();     \t \n        \tbreak;  \n        \tcase 7:  \n        \tsearching();    \t \n        \tbreak;  \n        \tcase 8:  \n        \tprint();   \t \n        \tbreak;  \n        \tcase 9:  \n        \texit(0);  \n        \tbreak;  \n        \tdefault:  \n        \tprintf(\"Please enter a choice from the following list!\");  \n    \t}  \n  }  \n}  \nvoid insert_at_begin()  \n{  \n  struct node *point;  \n  int value;  \n  point = (struct node *) malloc(sizeof(struct node *));  \n  if(point == NULL)  \n  {  \n    \tprintf(\"\\nInvalid!!\");  \n  }  \n  else  \n  {  \n    \tprintf(\"\\nEnter the value: \\n\");    \n    \tscanf(\"%d\",&amp;value);    \n    \tpoint-&gt;data = value;  \n    \tpoint-&gt;next = HEAD;  \n    \tHEAD = point;  \n    \tprintf(\"\\nNice, The Node is inserted at the beginning!\");  \n  }  \n \t \n}  \nvoid insert_at_last()  \n{  \n  struct node *point,*tmp;  \n  int value;\t \n  point = (struct node*)malloc(sizeof(struct node)); \t \n  if(point == NULL)  \n  {  \n    \tprintf(\"\\nInvalid!!\");\t \n  }  \n  else  \n  {  \n    \tprintf(\"\\nEnter the value: \\n\");  \n    \tscanf(\"%d\",&amp;value);  \n    \tpoint-&gt;data = value;  \n    \tif(HEAD == NULL)  \n    \t{  \n        \tpoint -&gt; next = NULL;  \n        \tHEAD = point;  \n        \tprintf(\"\\nNice, The Node is inserted!\");  \n    \t}  \n    \telse  \n    \t{  \n        \ttmp = HEAD;  \n        \twhile (tmp -&gt; next != NULL)  \n        \t{  \n            \ttmp = tmp -&gt; next;  \n        \t}  \n        \ttmp-&gt;next = point;  \n        \tpoint-&gt;next = NULL;  \n        \tprintf(\"\\nNice, The Node is inserted!\");  \n     \t \n    \t}  \n  }  \n}  \nvoid insert_random()  \n{  \n  int a,pos,value;   \n  struct node *point, *tmp;  \n  point = (struct node *) malloc (sizeof(struct node));  \n  if(point == NULL)  \n  {  \n    \tprintf(\"\\nInvalid!!\");  \n  }  \n  else  \n  {  \n    \tprintf(\"\\nEnter the value of element: \");  \n    \tscanf(\"%d\",&amp;value);  \n    \tpoint-&gt;data = value;  \n    \tprintf(\"\\nEnter the position where you want to insert: \");  \n    \tscanf(\"\\n%d\",&amp;pos);  \n    \ttmp=HEAD;  \n    \tfor(a=0;a&lt;pos;a++)  \n    \t{  \n        \ttmp = tmp-&gt;next;  \n        \tif(tmp == NULL)  \n        \t{  \n            \tprintf(\"\\nSorry, but you cannot insert!\\n\");  \n            \treturn;  \n        \t}  \n     \t \n    \t}  \n    \tpoint -&gt;next = tmp -&gt;next;   \n    \ttmp -&gt;next = point;   \n    \tprintf(\"\\nNice, The Node is inserted at your given location!\");  \n  }  \n}  \nvoid delete_at_begin()  \n{  \n  struct node *point;  \n  if(HEAD == NULL)  \n  {  \n    \tprintf(\"\\nThe List is empty!\\n\");  \n  }  \n  else   \n  {  \n    \tpoint = HEAD;  \n    \tHEAD = point-&gt;next;  \n    \tfree(point);  \n    \tprintf(\"\\nThe node is deleted from the beginning!\\n\");  \n  }  \n}  \nvoid delete_at_last()  \n{  \n  struct node *point,*point1;  \n  if(HEAD == NULL)  \n  {  \n    \tprintf(\"\\nThe List is empty!\");  \n  }  \n  else if(HEAD -&gt; next == NULL)  \n  {  \n    \tHEAD = NULL;  \n    \tfree(HEAD);  \n    \tprintf(\"\\nOne node is deleted from the list!\\n\");  \n  }  \n  else  \n  {  \n    \tpoint = HEAD;   \n    \twhile(point-&gt;next != NULL)  \n    \t{  \n        \tpoint1 = point;  \n        \tpoint = point -&gt;next;  \n    \t}  \n    \tpoint1-&gt;next = NULL;  \n    \tfree(point);  \n    \tprintf(\"\\nThe Node is deleted from the last of the node!\\n\");  \n  }\t \n}  \nvoid delete_random()  \n{  \n  struct node *point,*point1;  \n  int pos,a;    \n  printf(\"\\nEnter the position of the node after which you want to delete!\\n\");  \n  scanf(\"%d\",&amp;pos);  \n  point=HEAD;  \n  for(a=0;a&lt;pos;a++)  \n  {  \n    \tpoint1 = point;  \t \n    \tpoint = point-&gt;next;  \n         \t \n    \tif(point == NULL)  \n    \t{  \n        \tprintf(\"\\nSorry, but you cannot delete!\");  \n        \treturn;  \n    \t}  \n  }  \n  point1 -&gt;next = point -&gt;next;  \n  free(point);  \n  printf(\"\\nThe Node is deleted at location: %d\",pos+1);  \n}  \nvoid searching()  \n{  \n  struct node *point;  \n  int value,a=0,count;  \n  point = HEAD;   \n  if(point == NULL)  \n  {  \n    \tprintf(\"\\nSorry, but the list is empty!\\n\");  \n  }  \n  else  \n  {   \n    \tprintf(\"\\nEnter the value which you want to search: \\n\");   \n    \tscanf(\"%d\",&amp;value);  \n    \twhile (point!=NULL)  \n    \t{  \n        \tif(point-&gt;data == value)  \n        \t{  \n            \tprintf(\"The value which you searched for, found at: %d \",a+1);  \n            \tcount=0;  \n        \t}   \n        \telse  \n        \t{  \n            \tcount=1;  \n        \t}  \n        \ta++;  \n        \tpoint = point -&gt; next;  \n    \t}  \n  if(count==1)  \n  {  \n    \tprintf(\"Sorry, the value is not found!\\n\");  \n  }  \n  }\t \n     \t \n}  \n \nvoid print()  \n{  \n  struct node *point;  \n  point = HEAD;   \n  if(point == NULL)  \n  {  \n    \tprintf(\"Please enter something to print!\");  \n  }  \n  else  \n  {  \n    \tprintf(\"\\nPrinting the values!\\n\");   \n    \twhile (point!=NULL)  \n    \t{  \n        \tprintf(\"\\n%d\",point-&gt;data);  \n        \tpoint = point -&gt; next;  \n    \t}  \n  }  \n}<\/pre>\n<p><strong>Output:-<\/strong><\/p>\n<div class=\"code-output\">\n<p>**************************************<\/p>\n<p>TechVidvan Tutorial: Performing operations on Singly Linked List!<\/p>\n<p>Choose an option from the below list!<\/p>\n<p>**************************************<br \/>\n1.Do insertion at beginning of the list!<br \/>\n2.Do insertion at last!<br \/>\n3.Do insertion at random location!<br \/>\n4.Do deletion from the beginning of the list!<br \/>\n5.Do deletion at the last of the list!<br \/>\n6.Do deletion of a node after a specified node!<br \/>\n7.Perform a searching operation for an element!<br \/>\n8.Display!<br \/>\n9.Exit!<\/p>\n<p>Enter your choice?<br \/>\n1<\/p>\n<p>Enter the value:<br \/>\n25<\/p>\n<p>Nice, The Node is inserted at the beginning!<br \/>\n**************************************<\/p>\n<p>TechVidvan Tutorial: Performing operations on Singly Linked List!<\/p>\n<p>Choose an option from the below list!<\/p>\n<p>**************************************<br \/>\n1.Do insertion at beginning of the list!<br \/>\n2.Do insertion at last!<br \/>\n3.Do insertion at random location!<br \/>\n4.Do deletion from the beginning of the list!<br \/>\n5.Do deletion at the last of the list!<br \/>\n6.Do deletion of a node after a specified node!<br \/>\n7.Perform a searching operation for an element!<br \/>\n8.Display!<br \/>\n9.Exit!<\/p>\n<p>Enter your choice?<br \/>\n2<\/p>\n<p>Enter the value:<br \/>\n56<\/p>\n<p>Nice, The Node is inserted!<br \/>\n**************************************<\/p>\n<p>TechVidvan Tutorial: Performing operations on Singly Linked List!<\/p>\n<p>Choose an option from the below list!<\/p>\n<p>**************************************<br \/>\n1.Do insertion at beginning of the list!<br \/>\n2.Do insertion at last!<br \/>\n3.Do insertion at random location!<br \/>\n4.Do deletion from the beginning of the list!<br \/>\n5.Do deletion at the last of the list!<br \/>\n6.Do deletion of a node after a specified node!<br \/>\n7.Perform a searching operation for an element!<br \/>\n8.Display!<br \/>\n9.Exit!<\/p>\n<p>Enter your choice?<br \/>\n3<\/p>\n<p>Enter the value:<br \/>\n25<\/p>\n<p>Nice, The Node is inserted!<br \/>\n**************************************<\/p>\n<p>TechVidvan Tutorial: Performing operations on Singly Linked List!<\/p>\n<p>Choose an option from the below list!<\/p>\n<p>**************************************<br \/>\n1.Do insertion at beginning of the list!<br \/>\n2.Do insertion at last!<br \/>\n3.Do insertion at random location!<br \/>\n4.Do deletion from the beginning of the list!<br \/>\n5.Do deletion at the last of the list!<br \/>\n6.Do deletion of a node after a specified node!<br \/>\n7.Perform a searching operation for an element!<br \/>\n8.Display!<br \/>\n9.Exit!<\/p>\n<p>Enter your choice?<br \/>\n3<\/p>\n<p>Enter the value:<br \/>\n65<\/p>\n<p>Nice, The Node is inserted!<br \/>\n**************************************<\/p>\n<p>TechVidvan Tutorial: Performing operations on Singly Linked List!<\/p>\n<p>Choose an option from the below list!<\/p>\n<p>**************************************<br \/>\n1.Do insertion at beginning of the list!<br \/>\n2.Do insertion at last!<br \/>\n3.Do insertion at random location!<br \/>\n4.Do deletion from the beginning of the list!<br \/>\n5.Do deletion at the last of the list!<br \/>\n6.Do deletion of a node after a specified node!<br \/>\n7.Perform a searching operation for an element!<br \/>\n8.Display!<br \/>\n9.Exit!<\/p>\n<p>Enter your choice?<br \/>\n3<\/p>\n<p>Enter the value:<br \/>\n54<\/p>\n<p>Nice, The Node is inserted!<br \/>\n**************************************<\/p>\n<p>TechVidvan Tutorial: Performing operations on Singly Linked List!<\/p>\n<p>Choose an option from the below list!<\/p>\n<p>**************************************<br \/>\n1.Do insertion at beginning of the list!<br \/>\n2.Do insertion at last!<br \/>\n3.Do insertion at random location!<br \/>\n4.Do deletion from the beginning of the list!<br \/>\n5.Do deletion at the last of the list!<br \/>\n6.Do deletion of a node after a specified node!<br \/>\n7.Perform a searching operation for an element!<br \/>\n8.Display!<br \/>\n9.Exit!<\/p>\n<p>Enter your choice?<br \/>\n8<\/p>\n<p>Printing the values!<\/p>\n<p>25<br \/>\n56<br \/>\n25<br \/>\n65<br \/>\n54<br \/>\n**************************************<\/p>\n<p>TechVidvan Tutorial: Performing operations on Singly Linked List!<\/p>\n<p>Choose an option from the below list!<\/p>\n<p>**************************************<br \/>\n1.Do insertion at beginning of the list!<br \/>\n2.Do insertion at last!<br \/>\n3.Do insertion at random location!<br \/>\n4.Do deletion from the beginning of the list!<br \/>\n5.Do deletion at the last of the list!<br \/>\n6.Do deletion of a node after a specified node!<br \/>\n7.Perform a searching operation for an element!<br \/>\n8.Display!<br \/>\n9.Exit!<\/p>\n<p>Enter your choice?<br \/>\n4<\/p>\n<p>The node is deleted from the beginning!<\/p>\n<p>**************************************<\/p>\n<p>TechVidvan Tutorial: Performing operations on Singly Linked List!<\/p>\n<p>Choose an option from the below list!<\/p>\n<p>**************************************<br \/>\n1.Do insertion at beginning of the list!<br \/>\n2.Do insertion at last!<br \/>\n3.Do insertion at random location!<br \/>\n4.Do deletion from the beginning of the list!<br \/>\n5.Do deletion at the last of the list!<br \/>\n6.Do deletion of a node after a specified node!<br \/>\n7.Perform a searching operation for an element!<br \/>\n8.Display!<br \/>\n9.Exit!<\/p>\n<p>Enter your choice?<br \/>\n8<\/p>\n<p>Printing the values!<\/p>\n<p>56<br \/>\n25<br \/>\n65<br \/>\n54<br \/>\n**************************************<\/p>\n<p>TechVidvan Tutorial: Performing operations on Singly Linked List!<\/p>\n<p>Choose an option from the below list!<\/p>\n<p>**************************************<br \/>\n1.Do insertion at beginning of the list!<br \/>\n2.Do insertion at last!<br \/>\n3.Do insertion at random location!<br \/>\n4.Do deletion from the beginning of the list!<br \/>\n5.Do deletion at the last of the list!<br \/>\n6.Do deletion of a node after a specified node!<br \/>\n7.Perform a searching operation for an element!<br \/>\n8.Display!<br \/>\n9.Exit!<\/p>\n<p>Enter your choice?<br \/>\n5<\/p>\n<p>The Node is deleted from the last of the list!<\/p>\n<p>**************************************<\/p>\n<p>TechVidvan Tutorial: Performing operations on Singly Linked List!<\/p>\n<p>Choose an option from the below list!<\/p>\n<p>**************************************<br \/>\n1.Do insertion at beginning of the list!<br \/>\n2.Do insertion at last!<br \/>\n3.Do insertion at random location!<br \/>\n4.Do deletion from the beginning of the list!<br \/>\n5.Do deletion at the last of the list!<br \/>\n6.Do deletion of a node after a specified node!<br \/>\n7.Perform a searching operation for an element!<br \/>\n8.Display!<br \/>\n9.Exit!<\/p>\n<p>Enter your choice?<br \/>\n8<\/p>\n<p>Printing the values!<\/p>\n<p>56<br \/>\n25<br \/>\n65<br \/>\n**************************************<\/p>\n<p>TechVidvan Tutorial: Performing operations on Singly Linked List!<\/p>\n<p>Choose an option from the below list!<\/p>\n<p>**************************************<br \/>\n1.Do insertion at beginning of the list!<br \/>\n2.Do insertion at last!<br \/>\n3.Do insertion at random location!<br \/>\n4.Do deletion from the beginning of the list!<br \/>\n5.Do deletion at the last of the list!<br \/>\n6.Do deletion of a node after a specified node!<br \/>\n7.Perform a searching operation for an element!<br \/>\n8.Display!<br \/>\n9.Exit!<\/p>\n<p>Enter your choice?<br \/>\n6<\/p>\n<p>Enter the position of the node after which you want to delete!<br \/>\n2<\/p>\n<p>The Node is deleted at location: 3<br \/>\n**************************************<\/p>\n<p>TechVidvan Tutorial: Performing operations on Singly Linked List!<\/p>\n<p>Choose an option from the below list!<\/p>\n<p>**************************************<br \/>\n1.Do insertion at beginning of the list!<br \/>\n2.Do insertion at last!<br \/>\n3.Do insertion at random location!<br \/>\n4.Do deletion from the beginning of the list!<br \/>\n5.Do deletion at the last of the list!<br \/>\n6.Do deletion of a node after a specified node!<br \/>\n7.Perform a searching operation for an element!<br \/>\n8.Display!<br \/>\n9.Exit!<\/p>\n<p>Enter your choice?<br \/>\n8<\/p>\n<p>Printing the values!<\/p>\n<p>56<br \/>\n25<br \/>\n**************************************<\/p>\n<p>TechVidvan Tutorial: Performing operations on Singly Linked List!<\/p>\n<p>Choose an option from the below list!<\/p>\n<p>**************************************<br \/>\n1.Do insertion at beginning of the list!<br \/>\n2.Do insertion at last!<br \/>\n3.Do insertion at random location!<br \/>\n4.Do deletion from the beginning of the list!<br \/>\n5.Do deletion at the last of the list!<br \/>\n6.Do deletion of a node after a specified node!<br \/>\n7.Perform a searching operation for an element!<br \/>\n8.Display!<br \/>\n9.Exit!<\/p>\n<p>Enter your choice?<br \/>\n7<\/p>\n<p>Enter the value which you want to search:<br \/>\n25<br \/>\nThe value which you searched for, found at: 2<br \/>\n**************************************<\/p>\n<p>TechVidvan Tutorial: Performing operations on Singly Linked List!<\/p>\n<p>Choose an option from the below list!<\/p>\n<p>**************************************<br \/>\n1.Do insertion at beginning of the list!<br \/>\n2.Do insertion at last!<br \/>\n3.Do insertion at random location!<br \/>\n4.Do deletion from the beginning of the list!<br \/>\n5.Do deletion at the last of the list!<br \/>\n6.Do deletion of a node after a specified node!<br \/>\n7.Perform a searching operation for an element!<br \/>\n8.Display!<br \/>\n9.Exit!<\/p>\n<p>Enter your choice?<br \/>\n8<\/p>\n<p>Printing the values!<\/p>\n<p>56<br \/>\n25<br \/>\n**************************************<\/p>\n<p>TechVidvan Tutorial: Performing operations on Singly Linked List!<\/p>\n<p>Choose an option from the below list!<\/p>\n<p>**************************************<br \/>\n1.Do insertion at beginning of the list!<br \/>\n2.Do insertion at last!<br \/>\n3.Do insertion at random location!<br \/>\n4.Do deletion from the beginning of the list!<br \/>\n5.Do deletion at the last of the list!<br \/>\n6.Do deletion of a node after a specified node!<br \/>\n7.Perform a searching operation for an element!<br \/>\n8.Display!<br \/>\n9.Exit!<\/p>\n<p>Enter your choice?<br \/>\n7<\/p>\n<p>Enter the value which you want to search:<br \/>\n4<br \/>\nSorry, the value is not found!<\/p>\n<p>**************************************<\/p>\n<p>TechVidvan Tutorial: Performing operations on Singly Linked List!<\/p>\n<p>Choose an option from the below list!<\/p>\n<p>**************************************<br \/>\n1.Do insertion at beginning of the list!<br \/>\n2.Do insertion at last!<br \/>\n3.Do insertion at random location!<br \/>\n4.Do deletion from the beginning of the list!<br \/>\n5.Do deletion at the last of the list!<br \/>\n6.Do deletion of a node after a specified node!<br \/>\n7.Perform a searching operation for an element!<br \/>\n8.Display!<br \/>\n9.Exit!<\/p>\n<p>Enter your choice?<br \/>\n9<br \/>\nWe exit the program!<\/p>\n<\/div>\n<h3>Applications of Linked List in C:-<\/h3>\n<ul>\n<li>You can use linked lists on graphs and hash tables.<\/li>\n<li>In stack and queue, you can implement linked lists.<\/li>\n<li>With the help of linked lists, you can do dynamic memory allocation.<\/li>\n<li>With a linked list, you can perform arithmetic operations on long integers.<\/li>\n<\/ul>\n<h3>Advantages of Linked List in C:-<\/h3>\n<ul>\n<li>It is a dynamic data structure.<\/li>\n<li>You can decrease and increase the size of the linked list at run time.<\/li>\n<li>In the linked list, you can easily insert and delete a node.<\/li>\n<li>It\u2019s access time is very fast.<\/li>\n<li>In the linked list, memory is well utilized.<\/li>\n<\/ul>\n<h3>Disadvantages of Linked List in C:-<\/h3>\n<ul>\n<li>It requires more memory than an array.<\/li>\n<li>It is difficult to traverse the nodes in a linked list.<\/li>\n<li>Reverse traversing is very difficult to implement in a linked list.<\/li>\n<\/ul>\n<h3>Difference between Linked List and Array:-<\/h3>\n<table>\n<tbody>\n<tr>\n<td><b>Array<\/b><\/td>\n<td><b>Linked List<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">A collection of the same type of data type.<\/span><\/td>\n<td><span style=\"font-weight: 400\">A collection of similar items which are connected with each other with pointers.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Time Complexity is O(1).<\/span><\/td>\n<td><span style=\"font-weight: 400\">Time Complexity is O(n).<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">It allocates the memory at compile time.<\/span><\/td>\n<td><span style=\"font-weight: 400\">It allocates the memory at run time.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">In arrays, it is very difficult to perform insertion and deletion.\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">In the linked list, you can easily perform insertion and deletion.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Elements of an array are being stored in contiguous memory locations.<\/span><\/td>\n<td><span style=\"font-weight: 400\">But the linked list can be stored anywhere in the memory.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Summary:-<\/h3>\n<p>In this tutorial, we learnt about linked lists in C in depth. We discussed what is a linked list and what are the types of linked list in C. We also discussed different operations you can perform on a linked list in C in detail. Then we talked about the advantages, disadvantages, applications and usage of Linked Lis in Ct. We also discussed the difference between an array and a linked list and what is the benefit of using linked lists over an array. We also wrote a code which will perform different operations on a linked list.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>From the name, you can easily say that it is used for linking lists together. But to put it in a nice way, you can say that a linked list is the sequence of&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":83462,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3510],"tags":[3984,3985,3986,3987,3988,3989,3990,3991,3992],"class_list":["post-83085","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-programming","tag-advantages-of-linked-list","tag-circular-linked-list-in-c","tag-complexity-of-linked-list","tag-difference-between-linked-list-and-array","tag-disadvantages-of-linked-list","tag-doubly-linked-list-in-c","tag-linked-list-in-c","tag-singly-linked-list-in-c","tag-uses-of-linked-list-in-c"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Linked List in C Programming - TechVidvan<\/title>\n<meta name=\"description\" content=\"Learn what is a linked list in C, its advantages, limitations &amp; types of linked list. See different operations you can perform on linked list.\" \/>\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\/linked-lists-in-c\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linked List in C Programming - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Learn what is a linked list in C, its advantages, limitations &amp; types of linked list. See different operations you can perform on linked list.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/linked-lists-in-c\/\" \/>\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-08-10T03:30:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/Linked-Lists-in-C.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=\"18 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Linked List in C Programming - TechVidvan","description":"Learn what is a linked list in C, its advantages, limitations & types of linked list. See different operations you can perform on linked list.","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\/linked-lists-in-c\/","og_locale":"en_US","og_type":"article","og_title":"Linked List in C Programming - TechVidvan","og_description":"Learn what is a linked list in C, its advantages, limitations & types of linked list. See different operations you can perform on linked list.","og_url":"https:\/\/techvidvan.com\/tutorials\/linked-lists-in-c\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2021-08-10T03:30:08+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/Linked-Lists-in-C.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":"18 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/linked-lists-in-c\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/linked-lists-in-c\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Linked List in C Programming","datePublished":"2021-08-10T03:30:08+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/linked-lists-in-c\/"},"wordCount":2718,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/linked-lists-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/Linked-Lists-in-C.jpg","keywords":["Advantages of Linked List","Circular Linked List in C","Complexity of Linked List","Difference between Linked List and Array","Disadvantages of Linked List","Doubly Linked List in C","Linked List in C","Singly Linked List in C","Uses of Linked List in C"],"articleSection":["C Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/linked-lists-in-c\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/linked-lists-in-c\/","url":"https:\/\/techvidvan.com\/tutorials\/linked-lists-in-c\/","name":"Linked List in C Programming - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/linked-lists-in-c\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/linked-lists-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/Linked-Lists-in-C.jpg","datePublished":"2021-08-10T03:30:08+00:00","description":"Learn what is a linked list in C, its advantages, limitations & types of linked list. See different operations you can perform on linked list.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/linked-lists-in-c\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/linked-lists-in-c\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/linked-lists-in-c\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/Linked-Lists-in-C.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/Linked-Lists-in-C.jpg","width":1200,"height":628,"caption":"Linked Lists in C"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/linked-lists-in-c\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Linked List in C Programming"}]},{"@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\/83085","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=83085"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/83085\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/83462"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=83085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=83085"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=83085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}