{"id":499,"date":"2021-07-13T16:57:20","date_gmt":"2021-07-13T16:57:20","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=499"},"modified":"2021-09-13T06:50:32","modified_gmt":"2021-09-13T06:50:32","slug":"how-to-delete-an-element-in-a-linked-list","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-delete-an-element-in-a-linked-list\/","title":{"rendered":"How to delete an element in a linked list ?"},"content":{"rendered":"<div class=\"TextHeading\">\n<div class=\"hddn\">\n<h2 id=\"how-to-delete-an-element-in-a-linked-list\" class=\"color-pink\" style=\"text-align: justify;\">How to delete an element in a linked list ?<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>To delete a node from\u00a0<a href=\"https:\/\/www.wikitechy.com\/tutorials\/java\/java-linked-list\" target=\"_blank\" rel=\"noopener\">linked list<\/a>, we need to do following steps:\n<ul>\n<li>Find previous node of the node to be deleted.<\/li>\n<li>Change the next of previous node.<\/li>\n<li>Free\u00a0memory\u00a0for the node to be deleted<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"ImageContent\" style=\"text-align: justify;\">\n<div class=\"hddn\"><img decoding=\"async\" class=\"img-responsive center-block aligncenter\" src=\"https:\/\/cdn.wikitechy.com\/interview-questions\/data-structure\/linkedlist-deletion.png\" alt=\" \" \/><\/div>\n<\/div>\n<div class=\"TextHeading\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<h2 id=\"example\" class=\"color-purple\">Example<\/h2>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-markdown code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-markdown code-embed-code\">Input: position = 1, Linked List = 9->2->3->7->6<br\/>Output: Linked List =  9->3->7->6<br\/><br\/>Input: position = 0, Linked List = 9->2->3->7->6<br\/>Output: Linked List = 2->3->7->6<\/code><\/pre> <\/div>\n<h2 id=\"sample-code\" class=\"color-purple\">Sample code<\/h2>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-java code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-java code-embed-code\">#include <stdio.h> <br\/>#include <stdlib.h> <br\/><br\/>\/\/ A linked list node <br\/>struct Node <br\/>{ <br\/>\tint data; <br\/>\tstruct Node *next; <br\/>}; <br\/><br\/>\/* Given a reference (pointer to pointer) to the head of a list <br\/>and an int, inserts a new node on the front of the list. *\/<br\/>void push(struct Node** head_ref, int new_data) <br\/>{ <br\/>\tstruct Node* new_node = (struct Node*) malloc(sizeof(struct Node)); <br\/>\tnew_node->data = new_data; <br\/>\tnew_node->next = (*head_ref); <br\/>\t(*head_ref) = new_node; <br\/>} <br\/><br\/>\/* Given a reference (pointer to pointer) to the head of a list <br\/>and a position, deletes the node at the given position *\/<br\/>void deleteNode(struct Node **head_ref, int position) <br\/>{ <br\/>\/\/ If linked list is empty <br\/>if (*head_ref == NULL) <br\/>\treturn; <br\/><br\/>\/\/ Store head node <br\/>struct Node* temp = *head_ref; <br\/><br\/>\t\/\/ If head needs to be removed <br\/>\tif (position == 0) <br\/>\t{ <br\/>\t\t*head_ref = temp->next; \/\/ Change head <br\/>\t\tfree(temp);\t\t\t \/\/ free old head <br\/>\t\treturn; <br\/>\t} <br\/><br\/>\t\/\/ Find previous node of the node to be deleted <br\/>\tfor (int i=0; temp!=NULL && i<position-1; i++) <br\/>\t\ttemp = temp->next; <br\/><br\/>\t\/\/ If position is more than number of ndoes <br\/>\tif (temp == NULL || temp->next == NULL) <br\/>\t\treturn; <br\/><br\/>\t\/\/ Node temp->next is the node to be deleted <br\/>\t\/\/ Store pointer to the next of node to be deleted <br\/>\tstruct Node *next = temp->next->next; <br\/><br\/>\t\/\/ Unlink the node from linked list <br\/>\tfree(temp->next); \/\/ Free memory <br\/><br\/>\ttemp->next = next; \/\/ Unlink the deleted node from list <br\/>} <br\/><br\/>\/\/ This function prints contents of linked list starting from <br\/>\/\/ the given node <br\/>void printList(struct Node *node) <br\/>{ <br\/>\twhile (node != NULL) <br\/>\t{ <br\/>\t\tprintf(&quot; %d &quot;, node->data); <br\/>\t\tnode = node->next; <br\/>\t} <br\/>} <br\/><br\/>\/* Drier program to test above functions*\/<br\/>int main() <br\/>{ <br\/>\t\/* Start with the empty list *\/<br\/>\tstruct Node* head = NULL; <br\/><br\/>\tpush(&head, 6); <br\/>\tpush(&head, 7); <br\/>\tpush(&head, 3); <br\/>\tpush(&head, 2); <br\/>\tpush(&head, 9); <br\/><br\/>\tputs(&quot;Created Linked List: &quot;); <br\/>\tprintList(head); <br\/>\tdeleteNode(&head, 4); <br\/>\tputs(&quot;\\nLinked List after Deletion at position 4: &quot;); <br\/>\tprintList(head); <br\/>\treturn 0; <br\/>}<\/code><\/pre> <\/div>\n<h2 id=\"output\" class=\"color-purple\">Output:<\/h2>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-markdown code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-markdown code-embed-code\">Created Linked List: <br\/> 9  2  3  7  6 <br\/>Linked List after Deletion at position 4: <br\/> 9  2  3  7<\/code><\/pre> <\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Answer : To delete a node from linked list&#8230;.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3028],"tags":[195,971,491,221,368,3494,203,199,214,198,363,3057,15938,3493,3500,3498,3496,3495,3499,3503,3502,3432,205,222,484,3054,196,212,3501,207,366,204,3492,3497,206,972,200,3055,197,968,3056,285,969],"class_list":["post-499","post","type-post","status-publish","format-standard","hentry","category-data-structure","tag-accenture-interview-questions-and-answers","tag-altimetrik-india-pvt-ltd-interview-questions-and-answers","tag-applied-materials-interview-questions-and-answers","tag-bharti-airtel-interview-questions-and-answers","tag-bmc-software-interview-questions-and-answers","tag-c-program-to-delete-first-node-in-linked-list","tag-capgemini-interview-questions-and-answers","tag-casting-networks-india-pvt-limited-interview-questions-and-answers","tag-cgi-group-inc-interview-questions-and-answers","tag-chetu-interview-questions-and-answers","tag-ciena-corporation-interview-questions-and-answers","tag-collabera-te-interview-questions-and-answers","tag-compro-technologies-interview-questions-and-answers","tag-delete-a-node-from-linked-list-algorithm","tag-delete-a-node-in-linked-list-with-single-pointer","tag-delete-a-specific-node-in-linked-list-c","tag-delete-first-node-in-linked-list-c","tag-delete-node-at-given-position-in-a-linked-list","tag-delete-node-at-given-position-in-a-linked-list-c","tag-delete-node-at-given-position-in-a-linked-list-in-c","tag-delete-node-linked-list-c","tag-deletion-in-linked-list-in-data-structure","tag-dell-international-services-india-pvt-ltd-interview-questions-and-answers","tag-flipkart-interview-questions-and-answers","tag-genpact-interview-questions-and-answers","tag-globallogic-india-pvt-ltd-interview-questions-and-answers","tag-ibm-interview-questions-and-answers","tag-indecomm-global-services-interview-questions-and-answers","tag-linked-list-delete-node-c","tag-mphasis-interview-questions-and-answers","tag-netapp-interview-questions-and-answers","tag-oracle-corporation-interview-questions-and-answers","tag-remove-element-from-linked-list-c","tag-remove-middle-element-linked-list-c","tag-sap-labs-india-pvt-ltd-interview-questions-and-answers","tag-sapient-consulting-pvt-ltd-interview-questions-and-answers","tag-tech-mahindra-interview-questions-and-answers","tag-tracxn-technologies-pvt-ltd-interview-questions-and-answers","tag-unitedhealth-group-interview-questions-and-answers","tag-wipro-infotech-interview-questions-and-answers","tag-wm-global-technology-services-india-pvt-ltd-limited-wmgts-interview-questions-and-answers","tag-xoriant-solutions-pvt-ltd-interview-questions-and-answers","tag-yodlee-infotech-pvt-ltd-interview-questions-and-answers"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to delete an element in a linked list ? - Data Structure<\/title>\n<meta name=\"description\" content=\"How to delete an element in a linked list ? - Find previous node of the node to be deleted. Change the next of previous node.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-delete-an-element-in-a-linked-list\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to delete an element in a linked list ? - Data Structure\" \/>\n<meta property=\"og:description\" content=\"How to delete an element in a linked list ? - Find previous node of the node to be deleted. Change the next of previous node.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-delete-an-element-in-a-linked-list\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-13T16:57:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-13T06:50:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.wikitechy.com\/interview-questions\/data-structure\/linkedlist-deletion.png\" \/>\n<meta name=\"author\" content=\"Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/data-structure\\\/how-to-delete-an-element-in-a-linked-list\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/data-structure\\\/how-to-delete-an-element-in-a-linked-list\\\/\"},\"author\":{\"name\":\"Editor\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/4d5a581fb5470d1560324bddc5e8b757\"},\"headline\":\"How to delete an element in a linked list ?\",\"datePublished\":\"2021-07-13T16:57:20+00:00\",\"dateModified\":\"2021-09-13T06:50:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/data-structure\\\/how-to-delete-an-element-in-a-linked-list\\\/\"},\"wordCount\":647,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/data-structure\\\/how-to-delete-an-element-in-a-linked-list\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cdn.wikitechy.com\\\/interview-questions\\\/data-structure\\\/linkedlist-deletion.png\",\"keywords\":[\"Accenture interview questions and answers\",\"Altimetrik India Pvt Ltd interview questions and answers\",\"Applied Materials interview questions and answers\",\"Bharti Airtel interview questions and answers\",\"BMC Software interview questions and answers\",\"c program to delete first node in linked list\",\"Capgemini interview questions and answers\",\"CASTING NETWORKS INDIA PVT LIMITED interview questions and answers\",\"CGI Group Inc interview questions and answers\",\"Chetu interview questions and answers\",\"Ciena Corporation interview questions and answers\",\"Collabera Te interview questions and answers\",\"compro technologies interview questions and answers\",\"delete a node from linked list algorithm\",\"delete a node in linked list with single pointer\",\"delete a specific node in linked list c++\",\"delete first node in linked list c++\",\"delete node at given position in a linked list\",\"delete node at given position in a linked list c++\",\"delete node at given position in a linked list in c++\",\"delete node linked list c++\",\"deletion in linked list in data structure\",\"Dell International Services India Pvt Ltd interview questions and answers\",\"Flipkart interview questions and answers\",\"Genpact interview questions and answers\",\"Globallogic India Pvt Ltd interview questions and answers\",\"IBM interview questions and answers\",\"Indecomm Global Services interview questions and answers\",\"linked list delete node c++\",\"Mphasis interview questions and answers\",\"NetApp interview questions and answers\",\"Oracle Corporation interview questions and answers\",\"remove element from linked list c++\",\"remove middle element linked list c++\",\"SAP Labs India Pvt Ltd interview questions and answers\",\"Sapient Consulting Pvt Ltd interview questions and answers\",\"Tech Mahindra interview questions and answers\",\"Tracxn Technologies Pvt Ltd interview questions and answers\",\"UnitedHealth Group interview questions and answers\",\"Wipro Infotech interview questions and answers\",\"WM Global Technology Services India Pvt.Ltd Limited (WMGTS) interview questions and answers\",\"Xoriant Solutions Pvt Ltd interview questions and answers\",\"Yodlee Infotech Pvt Ltd interview questions and answers\"],\"articleSection\":[\"Data Structure\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/data-structure\\\/how-to-delete-an-element-in-a-linked-list\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/data-structure\\\/how-to-delete-an-element-in-a-linked-list\\\/\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/data-structure\\\/how-to-delete-an-element-in-a-linked-list\\\/\",\"name\":\"How to delete an element in a linked list ? - Data Structure\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/data-structure\\\/how-to-delete-an-element-in-a-linked-list\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/data-structure\\\/how-to-delete-an-element-in-a-linked-list\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cdn.wikitechy.com\\\/interview-questions\\\/data-structure\\\/linkedlist-deletion.png\",\"datePublished\":\"2021-07-13T16:57:20+00:00\",\"dateModified\":\"2021-09-13T06:50:32+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/4d5a581fb5470d1560324bddc5e8b757\"},\"description\":\"How to delete an element in a linked list ? - Find previous node of the node to be deleted. Change the next of previous node.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/data-structure\\\/how-to-delete-an-element-in-a-linked-list\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/data-structure\\\/how-to-delete-an-element-in-a-linked-list\\\/#primaryimage\",\"url\":\"https:\\\/\\\/cdn.wikitechy.com\\\/interview-questions\\\/data-structure\\\/linkedlist-deletion.png\",\"contentUrl\":\"https:\\\/\\\/cdn.wikitechy.com\\\/interview-questions\\\/data-structure\\\/linkedlist-deletion.png\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#website\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/\",\"name\":\"Wikitechy\",\"description\":\"Interview Questions\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/4d5a581fb5470d1560324bddc5e8b757\",\"name\":\"Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"caption\":\"Editor\"},\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/author\\\/editor\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to delete an element in a linked list ? - Data Structure","description":"How to delete an element in a linked list ? - Find previous node of the node to be deleted. Change the next of previous node.","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:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-delete-an-element-in-a-linked-list\/","og_locale":"en_US","og_type":"article","og_title":"How to delete an element in a linked list ? - Data Structure","og_description":"How to delete an element in a linked list ? - Find previous node of the node to be deleted. Change the next of previous node.","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-delete-an-element-in-a-linked-list\/","og_site_name":"Wikitechy","article_published_time":"2021-07-13T16:57:20+00:00","article_modified_time":"2021-09-13T06:50:32+00:00","og_image":[{"url":"https:\/\/cdn.wikitechy.com\/interview-questions\/data-structure\/linkedlist-deletion.png","type":"","width":"","height":""}],"author":"Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Editor","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-delete-an-element-in-a-linked-list\/#article","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-delete-an-element-in-a-linked-list\/"},"author":{"name":"Editor","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"headline":"How to delete an element in a linked list ?","datePublished":"2021-07-13T16:57:20+00:00","dateModified":"2021-09-13T06:50:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-delete-an-element-in-a-linked-list\/"},"wordCount":647,"commentCount":0,"image":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-delete-an-element-in-a-linked-list\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.wikitechy.com\/interview-questions\/data-structure\/linkedlist-deletion.png","keywords":["Accenture interview questions and answers","Altimetrik India Pvt Ltd interview questions and answers","Applied Materials interview questions and answers","Bharti Airtel interview questions and answers","BMC Software interview questions and answers","c program to delete first node in linked list","Capgemini interview questions and answers","CASTING NETWORKS INDIA PVT LIMITED interview questions and answers","CGI Group Inc interview questions and answers","Chetu interview questions and answers","Ciena Corporation interview questions and answers","Collabera Te interview questions and answers","compro technologies interview questions and answers","delete a node from linked list algorithm","delete a node in linked list with single pointer","delete a specific node in linked list c++","delete first node in linked list c++","delete node at given position in a linked list","delete node at given position in a linked list c++","delete node at given position in a linked list in c++","delete node linked list c++","deletion in linked list in data structure","Dell International Services India Pvt Ltd interview questions and answers","Flipkart interview questions and answers","Genpact interview questions and answers","Globallogic India Pvt Ltd interview questions and answers","IBM interview questions and answers","Indecomm Global Services interview questions and answers","linked list delete node c++","Mphasis interview questions and answers","NetApp interview questions and answers","Oracle Corporation interview questions and answers","remove element from linked list c++","remove middle element linked list c++","SAP Labs India Pvt Ltd interview questions and answers","Sapient Consulting Pvt Ltd interview questions and answers","Tech Mahindra interview questions and answers","Tracxn Technologies Pvt Ltd interview questions and answers","UnitedHealth Group interview questions and answers","Wipro Infotech interview questions and answers","WM Global Technology Services India Pvt.Ltd Limited (WMGTS) interview questions and answers","Xoriant Solutions Pvt Ltd interview questions and answers","Yodlee Infotech Pvt Ltd interview questions and answers"],"articleSection":["Data Structure"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-delete-an-element-in-a-linked-list\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-delete-an-element-in-a-linked-list\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-delete-an-element-in-a-linked-list\/","name":"How to delete an element in a linked list ? - Data Structure","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-delete-an-element-in-a-linked-list\/#primaryimage"},"image":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-delete-an-element-in-a-linked-list\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.wikitechy.com\/interview-questions\/data-structure\/linkedlist-deletion.png","datePublished":"2021-07-13T16:57:20+00:00","dateModified":"2021-09-13T06:50:32+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"description":"How to delete an element in a linked list ? - Find previous node of the node to be deleted. Change the next of previous node.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-delete-an-element-in-a-linked-list\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-delete-an-element-in-a-linked-list\/#primaryimage","url":"https:\/\/cdn.wikitechy.com\/interview-questions\/data-structure\/linkedlist-deletion.png","contentUrl":"https:\/\/cdn.wikitechy.com\/interview-questions\/data-structure\/linkedlist-deletion.png"},{"@type":"WebSite","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website","url":"https:\/\/www.wikitechy.com\/interview-questions\/","name":"Wikitechy","description":"Interview Questions","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757","name":"Editor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","caption":"Editor"},"url":"https:\/\/www.wikitechy.com\/interview-questions\/author\/editor\/"}]}},"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/499","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/comments?post=499"}],"version-history":[{"count":4,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/499\/revisions"}],"predecessor-version":[{"id":3504,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/499\/revisions\/3504"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=499"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}