<br />
<b>Warning</b>:  Undefined array key "global_protection_id" in <b>/home/wikitechy/public_html/interview-questions/wp-content/plugins/content-protector/inc/class-ps-rest-handler.php</b> on line <b>51</b><br />
{"id":505,"date":"2021-07-13T17:24:03","date_gmt":"2021-07-13T17:24:03","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=505"},"modified":"2021-09-13T06:40:17","modified_gmt":"2021-09-13T06:40:17","slug":"how-to-make-linked-list-program-for-the-given-list","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-make-linked-list-program-for-the-given-list\/","title":{"rendered":"How to make linked list program for the given list ?"},"content":{"rendered":"<div class=\"TextHeading\">\n<div class=\"hddn\">\n<h2 id=\"how-to-make-linked-list-program-for-the-given-list\" class=\"color-pink\" style=\"text-align: justify;\">How to make linked list program for the given list ?<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li><a href=\"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/what-is-linked-list-in-data-structure-with-example\/\" target=\"_blank\" rel=\"noopener\">Linked List<\/a>\u00a0is a type of Linear\u00a0<a href=\"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/what-is-data-structure\/\" target=\"_blank\" rel=\"noopener\">Data Structure<\/a>\u00a0that is mostly used data structure after array, which allocates\u00a0memory dynamically\u00a0at run time that is it doesn\u2019t require any size initialization as in case of array.<\/li>\n<li>Linked List stores data in the forms of nodes, which is divided into two parts, first part stores the data and second part points to the next node by storing the address of that node.<\/li>\n<li>We have first node which contains Data and Address to next node, and similarly second and third node forming a chain.<\/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\/linked-list-in-data-structure.png\" alt=\"Linked List in Data Structure\" \/><\/div>\n<\/div>\n<div class=\"TextHeading\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<h2 id=\"syntax\" class=\"color-blue\">Syntax<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>To create code, pattern required is:<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"CodeContent\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<figure class=\"highlight\">\n<pre><code id=\"code1\" class=\"hljs javascript\" data-lang=\"\"><span class=\"nt\">LinkedList&lt;<span class=\"hljs-built_in\">String<\/span>&gt; linkedList=<span class=\"hljs-keyword\">new<\/span> LinkedList&lt;<span class=\"hljs-built_in\">String<\/span>&gt;()<\/span><\/code><\/pre>\n<\/figure>\n<\/div>\n<\/div>\n<div class=\"TextHeading\">\n<div class=\"hddn\">\n<h2 id=\"sample-code-in-java\" class=\"color-purple\" style=\"text-align: justify;\">Sample Code in Java<\/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\">import java.util.Iterator;<br\/><br\/>import java.util.LinkedList;\t\t\t\t\t<br\/><br\/>public class LinkedListDemo <br\/>{<br\/><br\/>  public static void main (String[] args) {<br\/><br\/>  LinkedList&lt;String&gt; linkedList=new LinkedList&lt;String&gt;();<br\/><br\/>  linkedList.add(&quot;java&quot;);<br\/><br\/>  linkedList.add(&quot;Is&quot;);<br\/><br\/>  linkedList.add(&quot;High&quot;);<br\/><br\/>  linkedList.add(&quot;Level&quot;);<br\/><br\/>  linkedList.add(&quot;Language&quot;);<br\/><br\/>  Iterator&lt;String&gt; itr=linkedList.iterator();<br\/><br\/>  while(itr.hasNext())<br\/>  {<br\/><br\/>   System.out.print(itr.next());<br\/><br\/>   System.out.print(&quot;\\t&quot;);<br\/><br\/>  }<br\/><br\/> }<br\/><br\/>}<\/code><\/pre> <\/div>\n<div class=\"TextHeading\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<h2 id=\"output\" class=\"color-purple\">Output<\/h2>\n<\/div>\n<\/div>\n<div class=\"Output\">\n<div class=\"hddn\">\n<figure class=\"highlight\" style=\"text-align: justify;\">\n<pre><code class=\"hljs\" data-lang=\"\"><span class=\"nt\">java Is High Level Language<\/span><\/code><\/pre>\n<\/figure>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Answer : Linked List is a type of Linear Data Structure that is mostly used data structure&#8230;.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"passster_activate_protection":false,"passster_protect_child_pages":"","passster_protection_type":"password","passster_password":"","passster_activate_overwrite_defaults":"","passster_headline":"","passster_instruction":"","passster_placeholder":"","passster_button":"","passster_id":"","passster_activate_misc_settings":"","passster_redirect_url":"","passster_hide":"no","passster_area_shortcode":"","gtb_hide_title":false,"gtb_wrap_title":false,"gtb_class_title":"","gtb_remove_headerfooter":false,"footnotes":""},"categories":[3028],"tags":[195,971,491,221,368,203,199,214,198,363,3057,205,3571,15935,222,484,3054,3567,3558,196,212,3564,3561,3559,3565,3563,3556,3414,3206,3569,3566,3205,3555,3562,3557,3560,3202,3568,3554,207,366,204,206,972,3416,3419,3421,3570,200,3055,197,3572,968,3056,285,969],"class_list":["post-505","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-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-dell-international-services-india-pvt-ltd-interview-questions-and-answers","tag-doubly-linked-list-implementation-in-java","tag-ecare-technology-labs-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-how-to-create-a-linked-list-in-java","tag-how-to-create-a-node-in-linked-list-in-java","tag-ibm-interview-questions-and-answers","tag-indecomm-global-services-interview-questions-and-answers","tag-insert-a-node-at-a-specific-position-in-a-linked-list-in-java","tag-insert-node-at-beginning-of-linked-list-in-java","tag-insert-node-at-beginning-of-linked-list-java-program","tag-insertion-in-linked-list-algorithm","tag-java-program-to-insert-a-node-at-the-end-in-linked-list","tag-linked-list-add-method-implementation","tag-linked-list-data-structure-in-java","tag-linked-list-implementation-in-java","tag-linked-list-in-java","tag-linked-list-in-java-program","tag-linked-list-insertion","tag-linked-list-java","tag-linked-list-java-code","tag-linked-list-java-program","tag-linked-list-node-java","tag-linked-list-program-in-java","tag-linked-list-program-in-java-for-insertion-and-deletion","tag-linked-list-program-in-java-with-explanation","tag-mphasis-interview-questions-and-answers","tag-netapp-interview-questions-and-answers","tag-oracle-corporation-interview-questions-and-answers","tag-sap-labs-india-pvt-ltd-interview-questions-and-answers","tag-sapient-consulting-pvt-ltd-interview-questions-and-answers","tag-singly-linked-list-algorithm","tag-singly-linked-list-in-data-structure","tag-singly-linked-list-java","tag-singly-linked-list-program-in-java","tag-tech-mahindra-interview-questions-and-answers","tag-tracxn-technologies-pvt-ltd-interview-questions-and-answers","tag-unitedhealth-group-interview-questions-and-answers","tag-user-defined-linked-list-in-java","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 v22.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to make linked list program for the given list ? - Data Structure<\/title>\n<meta name=\"description\" content=\"How to make linked list program for the given list ? - We have first node which contains Data and Address to next 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-make-linked-list-program-for-the-given-list\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to make linked list program for the given list ? - Data Structure\" \/>\n<meta property=\"og:description\" content=\"How to make linked list program for the given list ? - We have first node which contains Data and Address to next node\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-make-linked-list-program-for-the-given-list\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-13T17:24:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-13T06:40:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.wikitechy.com\/interview-questions\/data-structure\/linked-list-in-data-structure.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\":\"WebPage\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-make-linked-list-program-for-the-given-list\/\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-make-linked-list-program-for-the-given-list\/\",\"name\":\"How to make linked list program for the given list ? - Data Structure\",\"isPartOf\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-make-linked-list-program-for-the-given-list\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-make-linked-list-program-for-the-given-list\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdn.wikitechy.com\/interview-questions\/data-structure\/linked-list-in-data-structure.png\",\"datePublished\":\"2021-07-13T17:24:03+00:00\",\"dateModified\":\"2021-09-13T06:40:17+00:00\",\"author\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757\"},\"description\":\"How to make linked list program for the given list ? - We have first node which contains Data and Address to next node\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-make-linked-list-program-for-the-given-list\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-make-linked-list-program-for-the-given-list\/#primaryimage\",\"url\":\"https:\/\/cdn.wikitechy.com\/interview-questions\/data-structure\/linked-list-in-data-structure.png\",\"contentUrl\":\"https:\/\/cdn.wikitechy.com\/interview-questions\/data-structure\/linked-list-in-data-structure.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\":\"required name=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:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/\",\"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 make linked list program for the given list ? - Data Structure","description":"How to make linked list program for the given list ? - We have first node which contains Data and Address to next 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-make-linked-list-program-for-the-given-list\/","og_locale":"en_US","og_type":"article","og_title":"How to make linked list program for the given list ? - Data Structure","og_description":"How to make linked list program for the given list ? - We have first node which contains Data and Address to next node","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-make-linked-list-program-for-the-given-list\/","og_site_name":"Wikitechy","article_published_time":"2021-07-13T17:24:03+00:00","article_modified_time":"2021-09-13T06:40:17+00:00","og_image":[{"url":"https:\/\/cdn.wikitechy.com\/interview-questions\/data-structure\/linked-list-in-data-structure.png"}],"author":"Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Editor","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-make-linked-list-program-for-the-given-list\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-make-linked-list-program-for-the-given-list\/","name":"How to make linked list program for the given list ? - Data Structure","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-make-linked-list-program-for-the-given-list\/#primaryimage"},"image":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-make-linked-list-program-for-the-given-list\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.wikitechy.com\/interview-questions\/data-structure\/linked-list-in-data-structure.png","datePublished":"2021-07-13T17:24:03+00:00","dateModified":"2021-09-13T06:40:17+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"description":"How to make linked list program for the given list ? - We have first node which contains Data and Address to next node","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-make-linked-list-program-for-the-given-list\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/how-to-make-linked-list-program-for-the-given-list\/#primaryimage","url":"https:\/\/cdn.wikitechy.com\/interview-questions\/data-structure\/linked-list-in-data-structure.png","contentUrl":"https:\/\/cdn.wikitechy.com\/interview-questions\/data-structure\/linked-list-in-data-structure.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":"required name=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:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/","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\/505","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=505"}],"version-history":[{"count":4,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/505\/revisions"}],"predecessor-version":[{"id":3496,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/505\/revisions\/3496"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}