{"id":3499,"date":"2021-08-03T09:56:49","date_gmt":"2021-08-03T09:56:49","guid":{"rendered":"https:\/\/www.prepbytes.com\/blog\/?p=3499"},"modified":"2023-07-24T06:41:15","modified_gmt":"2023-07-24T06:41:15","slug":"create-linked-list-from-a-given-array","status":"publish","type":"post","link":"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/","title":{"rendered":"Create Linked List From A Given Array"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1645186740922-Create%20linked%20list_Artboard%201.png\" alt=\"\" \/><\/p>\n<p>In certain situations, linked lists are preferred over arrays because they offer faster insertion and deletion operations. Unlike arrays, linked lists do not require a predefined size. As a result, we will explore how to convert array to linked list in this blog. Let&#8217;s examine the problem statement to gain a clearer understanding.<\/p>\n<h2>How to convert array to linked list<\/h2>\n<p>In this particular problem, we are presented with an array and tasked with constructing a linked list based on the given array. The concept behind this task is straightforward, making it a fundamental exercise for grasping the fundamentals of linked lists.<\/p>\n<p>Let me explain this problem with an example test case-<\/p>\n<h4>Sample Input<\/h4>\n<p>Array: arr[]={0, 2, 3, 5, 1}<\/p>\n<h4>Sample Output<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes.com\/blog\/wp-content\/uploads\/2021\/08\/74_1-01.png\" alt=\"\" \/><\/p>\n<h3>Approach regarding create linked list from a given array<\/h3>\n<p>The approach involves traversing the array from one end to the other. For each element encountered during the traversal, a new node is created with that element&#8217;s value, and then the node is inserted into the linked list.<\/p>\n<h3>Algorithm to convert array to linked list<\/h3>\n<p><strong>Algorithm to convert array to linked list<\/strong><\/p>\n<ul>\n<li>Here&#8217;s a step-by-step algorithm to convert array to linked list:<\/li>\n<li>Start with an empty linked list (initialize the head pointer as null).<\/li>\n<li>Traverse the array from the beginning to the end.<\/li>\n<li>For each element in the array:<\/li>\n<li>Create a new node with the current element&#8217;s value.<\/li>\n<li>If the linked list is empty (head is null), set the new node as the head.<\/li>\n<li>Otherwise, set the next pointer of the last node in the linked list to point to the new node.<\/li>\n<li>Update the last node pointer to the newly created node.<\/li>\n<li>After processing all elements in the array, the linked list is constructed.<\/li>\n<\/ul>\n<h3>Dry Run on How to convert array to linked list<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes.com\/blog\/wp-content\/uploads\/2021\/08\/74_2-01.png\" alt=\"\" \/><\/p>\n<h4>Code Implementation to create linked list from array<\/h4>\n\t\t\t\t\t\t<style>\r\n\t\t\t\t\r\n\t\t\t\t\t#tab_container_3716 {\r\n\toverflow:hidden;\r\n\tdisplay:block;\r\n\twidth:100%;\r\n\tborder:0px solid #ddd;\r\n\tmargin-bottom:30px;\r\n\t}\r\n\r\n#tab_container_3716 .tab-content{\r\n\tpadding:20px;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n\tmargin-top: 0px;\r\n\tbackground-color:#ffffff !important;\r\n\tcolor: #000000 !important;\r\n\tfont-size:16px !important;\r\n\tfont-family: Open Sans !important;\r\n\t\r\n\t\tborder: 1px solid #e6e6e6 !important;\r\n\t}\r\n#tab_container_3716 .wpsm_nav-tabs {\r\n    border-bottom: 0px solid #ddd;\r\n}\r\n#tab_container_3716 .wpsm_nav-tabs > li.active > a, #tab_container_3716 .wpsm_nav-tabs > li.active > a:hover, #tab_container_3716 .wpsm_nav-tabs > li.active > a:focus {\r\n\tcolor: #000000 !important;\r\n\tcursor: default;\r\n\tbackground-color: #ffffff !important;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n}\r\n\r\n#tab_container_3716 .wpsm_nav-tabs > li > a {\r\n    margin-right: 0px !important; \r\n    line-height: 1.42857143 !important;\r\n    border: 1px solid #d5d5d5 !important;\r\n    border-radius: 0px 0px 0 0 !important; \r\n\tbackground-color: #e8e8e8 !important;\r\n\tcolor: #000000 !important;\r\n\tpadding: 15px 18px 15px 18px !important;\r\n\ttext-decoration: none !important;\r\n\tfont-size: 14px !important;\r\n\ttext-align:center !important;\r\n\tfont-family: Open Sans !important;\r\n}\r\n#tab_container_3716 .wpsm_nav-tabs > li > a:focus {\r\noutline: 0px !important;\r\n}\r\n\r\n#tab_container_3716 .wpsm_nav-tabs > li > a:before {\r\n\tdisplay:none !important;\r\n}\r\n#tab_container_3716 .wpsm_nav-tabs > li > a:after {\r\n\tdisplay:none !important ;\r\n}\r\n#tab_container_3716 .wpsm_nav-tabs > li{\r\npadding:0px !important ;\r\nmargin:0px;\r\n}\r\n\r\n#tab_container_3716 .wpsm_nav-tabs > li > a:hover , #tab_container_3716 .wpsm_nav-tabs > li > a:focus {\r\n    color: #000000 !important;\r\n    background-color: #e8e8e8 !important;\r\n\tborder: 1px solid #d5d5d5 !important;\r\n\t\r\n}\r\n#tab_container_3716 .wpsm_nav-tabs > li > a .fa{\r\n\r\nmargin-right:5px !important;\r\n\r\nmargin-left:5px !important;\r\n\r\n\r\n}\r\n\r\n\t\t#tab_container_3716 .wpsm_nav-tabs a{\r\n\t\t\tbackground-image: none;\r\n\t\t\tbackground-position: 0 0;\r\n\t\t\tbackground-repeat: repeat-x;\r\n\t\t}\r\n\t\t\t\r\n\r\n\r\n#tab_container_3716 .wpsm_nav-tabs > li {\r\n    float: left;\r\n    margin-bottom: -1px !important;\r\n\tmargin-right:0px !important; \r\n}\r\n\r\n\r\n#tab_container_3716 .tab-content{\r\noverflow:hidden !important;\r\n}\r\n\r\n\r\n@media (min-width: 769px) {\r\n\r\n\t#tab_container_3716 .wpsm_nav-tabs > li{\r\n\t\tfloat:left !important ;\r\n\t\t\t\tmargin-right:-1px !important;\r\n\t\t\t\t\t}\r\n\t#tab_container_3716 .wpsm_nav-tabs{\r\n\t\tfloat:none !important;\r\n\t\tmargin:0px !important;\r\n\t}\r\n\r\n\t#tab_container_3716 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_3716 .wpsm_nav{\r\n\t\t\t}\r\n\r\n}\r\n\r\n\r\n\r\n@media (max-width: 768px) {\r\n\t#tab_container_3716 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_3716 .wpsm_nav{\r\n\t\t\t}\r\n}\r\n\r\n\r\n\t.wpsm_nav-tabs li:before{\r\n\t\tdisplay:none !important;\r\n\t}\r\n\r\n\t@media (max-width: 768px) {\r\n\t\t\t\t\r\n\t\t\t\t.wpsm_nav-tabs{\r\n\t\t\tmargin-left:0px !important;\r\n\t\t\tmargin-right:0px !important; \r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t#tab_container_3716 .wpsm_nav-tabs > li{\r\n\t\t\tfloat:none !important;\r\n\t\t}\r\n\t\t\t\r\n\t}\t\t\t\t<\/style>\r\n\t\t\t\t<div id=\"tab_container_3716\" >\r\n\t \r\n\t\t\t\t\t<ul class=\"wpsm_nav wpsm_nav-tabs\" role=\"tablist\" id=\"myTab_3716\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  class=\"active\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_3716_1\" aria-controls=\"tabs_desc_3716_1\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>C<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_3716_2\" aria-controls=\"tabs_desc_3716_2\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>C++<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_3716_3\" aria-controls=\"tabs_desc_3716_3\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>Java<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_3716_4\" aria-controls=\"tabs_desc_3716_4\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>Python<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\t\t\t\t <\/ul>\r\n\r\n\t\t\t\t\t  <!-- Tab panes -->\r\n\t\t\t\t\t  <div class=\"tab-content\" id=\"tab-content_3716\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane  in active \" id=\"tabs_desc_3716_1\">\r\n\t\t\t\t\t\t\t\t<!-- wp:enlighter\/codeblock {\"language\":\"c\"} -->\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\r\n#include&lt;stdio.h&gt;\r\n#include&lt;stdlib.h&gt;\r\n\r\nstruct Node {\r\n    int data;\r\n    struct Node* next;\r\n};\r\nvoid insert(struct Node** root, int item)\r\n{\r\n   struct Node* temp = (struct Node*) malloc(sizeof(struct Node));\r\n    struct Node* ptr;\r\n    temp-&gt;data = item;\r\n    temp-&gt;next = NULL;\r\n    if (*root == NULL)\r\n        *root = temp;\r\n    else {\r\n        ptr = *root;\r\n        while (ptr-&gt;next != NULL)\r\n            ptr = ptr-&gt;next;\r\n        ptr-&gt;next = temp;\r\n    }\r\n}\r\nvoid print(struct Node* root)\r\n{\r\n    while (root != NULL) {\r\n        printf(&quot;%d-&gt;&quot;, root-&gt;data);\r\n        root = root-&gt;next;\r\n    }\r\n}\r\nstruct Node *arrayToList(int arr[], int n)\r\n{\r\n    struct Node *root = NULL;\r\n    for (int i = 0; i &lt; n; i++)\r\n        insert(&amp;root, arr[i]);\r\nreturn root;\r\n}\r\nint main()\r\n{\r\n    int arr[] = { 0, 2, 3, 5, 1 };\r\n    int n = sizeof(arr) \/ sizeof(arr[0]);\r\n    struct Node* root = arrayToList(arr, n);\r\n    print(root);\r\n    return 0;\r\n}\r\n<\/pre>\r\n<!-- \/wp:enlighter\/codeblock -->\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane \" id=\"tabs_desc_3716_2\">\r\n\t\t\t\t\t\t\t\t<!-- wp:enlighter\/codeblock {\"language\":\"cpp\"} -->\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\r\n#include &lt;iostream&gt;\r\nusing namespace std;\r\nstruct Node {\r\n    int data;\r\n    Node* next;\r\n};\r\nvoid insert(Node** root, int item)\r\n{\r\n    Node* temp = new Node;\r\n    Node* ptr;\r\n    temp-&gt;data = item;\r\n    temp-&gt;next = NULL;\r\n\r\n    if (*root == NULL)\r\n        *root = temp;\r\n    else {\r\n        ptr = *root;\r\n        while (ptr-&gt;next != NULL)\r\n            ptr = ptr-&gt;next;\r\n        ptr-&gt;next = temp;\r\n    }\r\n}\r\n\r\nvoid print(Node* root)\r\n{\r\n    while (root != NULL) {\r\n        cout &lt;&lt; root-&gt;data &lt;&lt; &quot; &quot;;\r\n        root = root-&gt;next;\r\n    }\r\n}\r\n\r\nNode *arrayToList(int arr[], int n)\r\n{\r\n    Node *root = NULL;\r\n    for (int i = 0; i &lt; n; i++)\r\n        insert(&amp;root, arr[i]);\r\nreturn root;\r\n}\r\nint main()\r\n{\r\n    int arr[] = { 0, 2, 3, 5, 1 };\r\n    int n = sizeof(arr) \/ sizeof(arr[0]);\r\n    Node* root = arrayToList(arr, n);\r\n    print(root);\r\n    return 0;\r\n}\r\n<\/pre>\r\n<!-- \/wp:enlighter\/codeblock -->\r\n\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane \" id=\"tabs_desc_3716_3\">\r\n\t\t\t\t\t\t\t\t<!-- wp:enlighter\/codeblock {\"language\":\"java\"} -->\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\r\nclass LinkedList\r\n{\r\n\r\n\/\/ Representation of a node\r\nstatic class Node\r\n{\r\n    int data;\r\n    Node next;\r\n};\r\nstatic Node root;\r\n\r\n\/\/ Function to insert node\r\nstatic Node insert(Node root, int item)\r\n{\r\n    Node temp = new Node();\r\n    temp.data = item;\r\n    temp.next = root;\r\n    root = temp;\r\n    return root;\r\n}\r\n\r\nstatic void display(Node root)\r\n{\r\n    while (root != null)\r\n    {\r\n        System.out.print(root.data + &quot; &quot;);\r\n        root = root.next;\r\n    }\r\n}\r\n\r\nstatic Node arrayToList(int arr[], int n)\r\n{\r\n    root = null;\r\n    for (int i = n - 1; i &gt;= 0 ; i--)\r\n        root = insert(root, arr[i]);\r\n    return root;\r\n}\r\n\r\n\/\/ Driver code\r\npublic static void main(String[] args)\r\n{\r\n    int arr[] = { 1, 2, 3, 4, 5 };\r\n    int n = arr.length;\r\n    Node root = arrayToList(arr, n);\r\n    display(root);\r\n}\r\n}\r\n<\/pre>\r\n<!-- \/wp:enlighter\/codeblock -->\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane \" id=\"tabs_desc_3716_4\">\r\n\t\t\t\t\t\t\t\t<!-- wp:enlighter\/codeblock {\"language\":\"python\"} -->\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\r\nclass Node:\r\n\tdef __init__(self, data):\r\n\t\tself.data = data\r\n\t\tself.next = None\r\n\r\ndef insert(root, item):\r\n\ttemp = Node(item)\r\n\t\r\n\tif (root == None):\r\n\t\troot = temp\r\n\telse :\r\n\t\tptr = root\r\n\t\twhile (ptr.next != None):\r\n\t\t\tptr = ptr.next\r\n\t\tptr.next = temp\r\n\t\r\n\treturn root\r\n\r\ndef display(root):\r\n\twhile (root != None) :\r\n\t\tprint(root.data, end = \" \")\r\n\t\troot = root.next\r\n\t\t\r\ndef arrayToList(arr, n):\r\n\troot = None\r\n\tfor i in range(0, n, 1):\r\n\t\troot = insert(root, arr[i])\r\n\t\r\n\treturn root\r\n\r\nif __name__=='__main__':\r\n\tarr = [0, 2, 3, 4, 5, 1]\r\n\tn = len(arr)\r\n\troot = arrayToList(arr, n)\r\n\tdisplay(root)\r\n<\/pre>\r\n<!-- \/wp:enlighter\/codeblock -->\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t <\/div>\r\n\t\t\t\t\t \r\n\t\t\t\t <\/div>\r\n <script>\r\n\t\tjQuery(function () {\r\n\t\t\tjQuery('#myTab_3716 a:first').tab('show')\r\n\t\t});\r\n\t\t\r\n\t\t\t\tjQuery(function(){\r\n\t\t\tvar b=\"fadeIn\";\r\n\t\t\tvar c;\r\n\t\t\tvar a;\r\n\t\t\td(jQuery(\"#myTab_3716 a\"),jQuery(\"#tab-content_3716\"));function d(e,f,g){\r\n\t\t\t\te.click(function(i){\r\n\t\t\t\t\ti.preventDefault();\r\n\t\t\t\t\tjQuery(this).tab(\"show\");\r\n\t\t\t\t\tvar h=jQuery(this).data(\"easein\");\r\n\t\t\t\t\tif(c){c.removeClass(a);}\r\n\t\t\t\t\tif(h){f.find(\"div.active\").addClass(\"animated \"+h);a=h;}\r\n\t\t\t\t\telse{if(g){f.find(\"div.active\").addClass(\"animated \"+g);a=g;}else{f.find(\"div.active\").addClass(\"animated \"+b);a=b;}}c=f.find(\"div.active\");\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\r\n\t\tfunction do_resize(){\r\n\r\n\t\t\tvar width=jQuery( '.tab-content .tab-pane iframe' ).width();\r\n\t\t\tvar height=jQuery( '.tab-content .tab-pane iframe' ).height();\r\n\r\n\t\t\tvar toggleSize = true;\r\n\t\t\tjQuery('iframe').animate({\r\n\t\t\t    width: toggleSize ? width : 640,\r\n\t\t\t    height: toggleSize ? height : 360\r\n\t\t\t  }, 250);\r\n\r\n\t\t\t  toggleSize = !toggleSize;\r\n\t\t}\r\n\r\n\r\n\t<\/script>\r\n\t\t\t\t\r\n\t\t\t\n<h4>Output:<\/h4>\n<p>0-&gt;2-&gt;3-&gt;5-&gt;1<\/p>\n<p><strong>Space complexity  to create linked list from array :<\/strong> O(1), no extra space is used in this approach.<\/p>\n<h3>Conclusion<\/h3>\n<p>This blog tried to discuss how easily you can create linked list from array and described their time and space complexities. Also, we will explain the proper step-by-step dry run for better understanding. Hope this article \u201ccreate linked list from array \u201d enhances your knowledge of linked lists. To practice more problems on LinkedList you can check out at PrepBytes <a href=\"https:\/\/mycode.prepbytes.com\/interview-coding\/practice\/linked-list\">Linked List<\/a>.<\/p>\n<table width=\"641\">\n<tbody>\n<tr>\n<td colspan=\"2\" width=\"641\" style=\"text-align: center\"><strong>Related Articles<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/doubly-circular-linked-list-introduction-and-insertion\/\">Doubly circular linked list in data structure<\/a><\/td>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/advantages-disadvantages-and-uses-of-a-doubly-linked-list\/\">Application of doubly linked list<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/applications-of-linked-list-data-structure\/\">Applications of linked list<\/a><\/td>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/difference-between-a-singly-linked-list-and-a-doubly-linked-list\/\">Singly linked list vs doubly linked list<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/advantage-and-disadvantage-of-linked-list-over-array\/\">Advantages and disadvantages of linked list<\/a><\/td>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/menu-driven-program-for-all-operations-on-doubly-linked-list-in-c\/\">Doubly linked list all operations in C<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/binary-search\/binary-search-on-linked-list\/\">Binary search in linked list<\/a><\/td>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/bubble-sort-for-linked-list-by-swapping-nodes\/\">Bubble sort linked list<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/delete-a-node-in-doubly-linked-list\/\">Deletion in doubly linked list<\/a><\/td>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/delete-middle-of-linked-list\/\">Delete the middle node of a linked list<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/adding-two-polynomials-using-linked-list\/\">Polynomial addition using linked list<\/a><\/td>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/find-the-smallest-and-largest-elements-in-a-singly-linked-list\/\">Find max value and min value in linked list<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/insert-a-node-at-a-specific-position-in-a-linked-list\/\">Insert a node at a specific position in a linked list<\/a><\/td>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/swap-nodes-in-a-linked-list-without-swapping-data\/\">Swap nodes in linked list<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/add-two-numbers-represented-by-linked-lists-set-1\/\">Add two numbers represented by linked lists<\/a><\/td>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/find-the-first-node-of-the-loop-in-a-linked-list\/\">Find starting point of loop in linked list<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/merge-sort-on-a-singly-linked-list\/\">Merge sort linked list<\/a><\/td>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/delete-a-node-at-a-given-position\/\">Delete a node from linked list at a given position<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/linked-list\/remove-duplicates-from-an-unsorted-linked-list\/\">Remove duplicates from unsorted linked list<\/a><\/td>\n<td width=\"321\"><a href=\"https:\/\/prepbytes.com\/blog\/python\/python-program-to-reverse-a-linked-list\/\">Reverse a linked list in Python<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Conclusion<\/strong><br \/>\nConverting an array to a linked list is a fundamental operation in data structure and programming. The process involves traversing the array and creating a new node for each element, which is then inserted into the linked list. This conversion is valuable when dealing with dynamic data structures, as linked lists offer more flexibility in memory allocation and faster insertion and deletion operations.<\/p>\n<h2>Frequently Asked Questions (FAQs) related to converting array to linked list:<\/h2>\n<p><strong>Q1. Why would you convert an array to a linked list?<\/strong><br \/>\nConverting an array to a linked list is beneficial when you need to handle dynamic data or perform frequent insertions or deletions. Linked lists offer better performance for these operations compared to arrays, which require resizing and shifting elements for dynamic changes.<\/p>\n<p><strong>Q2. What is the time complexity of converting an array to a linked list?<\/strong><br \/>\nThe time complexity of converting an array to a linked list is O(n), where n is the number of elements in the array. This is because you need to traverse the entire array to create nodes for each element.<\/p>\n<p><strong>Q3. Can you convert a linked list back to an array?<\/strong><br \/>\nYes, it is possible to convert a linked list back to an array. You would need to traverse the linked list and store each element&#8217;s value in an array. The time complexity for this conversion is also O(n), where n is the number of elements in the linked list.<\/p>\n<p><strong>Q4. When should I use an array instead of a linked list?<\/strong><br \/>\nArrays are generally more efficient for random access and have better cache locality, making them suitable for scenarios where you frequently need to access elements by their index. Linked lists are more appropriate for situations requiring frequent insertions and deletions, especially in the middle of the data structure.<\/p>\n<p><strong>Q5. Are there any limitations to using linked lists?<\/strong><br \/>\nLinked lists have some drawbacks, such as the additional memory overhead for maintaining node references and the lack of constant-time random access. Additionally, traversing a linked list to find a specific element may take longer than using an array with direct access.<\/p>\n<p><strong>Q6. Can I convert a multidimensional array to a linked list of linked lists?<\/strong><br \/>\nYes, you can convert a multidimensional array to a linked list of linked lists by recursively converting each dimension into a separate linked list. Each node in the outer linked list would point to another linked list representing the inner dimension.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In certain situations, linked lists are preferred over arrays because they offer faster insertion and deletion operations. Unlike arrays, linked lists do not require a predefined size. As a result, we will explore how to convert array to linked list in this blog. Let&#8217;s examine the problem statement to gain a clearer understanding. How to [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[125],"tags":[],"class_list":["post-3499","post","type-post","status-publish","format-standard","hentry","category-linked-list"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Create Linked List From A Given Array | Linked List | Prepbytes<\/title>\n<meta name=\"description\" content=\"Learn to create a linked list in the simplest way from a given array. This blog explains how easily you can create a linked list from a given array of elements.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create Linked List From A Given Array | Linked List | Prepbytes\" \/>\n<meta property=\"og:description\" content=\"Learn to create a linked list in the simplest way from a given array. This blog explains how easily you can create a linked list from a given array of elements.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/\" \/>\n<meta property=\"og:site_name\" content=\"PrepBytes Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prepbytes0211\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-03T09:56:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-24T06:41:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1645186740922-Create%20linked%20list_Artboard%201.png\" \/>\n<meta name=\"author\" content=\"PrepBytes\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"PrepBytes\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/\"},\"author\":{\"name\":\"PrepBytes\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/39fcf072e04987f16796546f2ca83c2e\"},\"headline\":\"Create Linked List From A Given Array\",\"datePublished\":\"2021-08-03T09:56:49+00:00\",\"dateModified\":\"2023-07-24T06:41:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/\"},\"wordCount\":942,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/43.205.93.38\/#organization\"},\"image\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1645186740922-Create%20linked%20list_Artboard%201.png\",\"articleSection\":[\"Linked list articles\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/\",\"url\":\"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/\",\"name\":\"Create Linked List From A Given Array | Linked List | Prepbytes\",\"isPartOf\":{\"@id\":\"http:\/\/43.205.93.38\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1645186740922-Create%20linked%20list_Artboard%201.png\",\"datePublished\":\"2021-08-03T09:56:49+00:00\",\"dateModified\":\"2023-07-24T06:41:15+00:00\",\"description\":\"Learn to create a linked list in the simplest way from a given array. This blog explains how easily you can create a linked list from a given array of elements.\",\"breadcrumb\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/#primaryimage\",\"url\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1645186740922-Create%20linked%20list_Artboard%201.png\",\"contentUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1645186740922-Create%20linked%20list_Artboard%201.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/43.205.93.38\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linked list articles\",\"item\":\"https:\/\/prepbytes.com\/blog\/category\/linked-list\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Create Linked List From A Given Array\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/43.205.93.38\/#website\",\"url\":\"http:\/\/43.205.93.38\/\",\"name\":\"PrepBytes Blog\",\"description\":\"ONE-STOP RESOURCE FOR EVERYTHING RELATED TO CODING\",\"publisher\":{\"@id\":\"http:\/\/43.205.93.38\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/43.205.93.38\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/43.205.93.38\/#organization\",\"name\":\"Prepbytes\",\"url\":\"http:\/\/43.205.93.38\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp\",\"contentUrl\":\"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp\",\"width\":160,\"height\":160,\"caption\":\"Prepbytes\"},\"image\":{\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/prepbytes0211\/\",\"https:\/\/www.instagram.com\/prepbytes\/\",\"https:\/\/www.linkedin.com\/company\/prepbytes\/\",\"https:\/\/www.youtube.com\/channel\/UC0xGnHDrjUM1pDEK2Ka5imA\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/39fcf072e04987f16796546f2ca83c2e\",\"name\":\"PrepBytes\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/850669d326db1e1531f04db0c63145d941c2a26792aaeee226a9e6675b0ac698?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/850669d326db1e1531f04db0c63145d941c2a26792aaeee226a9e6675b0ac698?s=96&d=mm&r=g\",\"caption\":\"PrepBytes\"},\"url\":\"https:\/\/prepbytes.com\/blog\/author\/prepbytes\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create Linked List From A Given Array | Linked List | Prepbytes","description":"Learn to create a linked list in the simplest way from a given array. This blog explains how easily you can create a linked list from a given array of elements.","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:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/","og_locale":"en_US","og_type":"article","og_title":"Create Linked List From A Given Array | Linked List | Prepbytes","og_description":"Learn to create a linked list in the simplest way from a given array. This blog explains how easily you can create a linked list from a given array of elements.","og_url":"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/","og_site_name":"PrepBytes Blog","article_publisher":"https:\/\/www.facebook.com\/prepbytes0211\/","article_published_time":"2021-08-03T09:56:49+00:00","article_modified_time":"2023-07-24T06:41:15+00:00","og_image":[{"url":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1645186740922-Create%20linked%20list_Artboard%201.png","type":"","width":"","height":""}],"author":"PrepBytes","twitter_card":"summary_large_image","twitter_misc":{"Written by":"PrepBytes","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/#article","isPartOf":{"@id":"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/"},"author":{"name":"PrepBytes","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/39fcf072e04987f16796546f2ca83c2e"},"headline":"Create Linked List From A Given Array","datePublished":"2021-08-03T09:56:49+00:00","dateModified":"2023-07-24T06:41:15+00:00","mainEntityOfPage":{"@id":"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/"},"wordCount":942,"commentCount":0,"publisher":{"@id":"http:\/\/43.205.93.38\/#organization"},"image":{"@id":"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/#primaryimage"},"thumbnailUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1645186740922-Create%20linked%20list_Artboard%201.png","articleSection":["Linked list articles"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/","url":"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/","name":"Create Linked List From A Given Array | Linked List | Prepbytes","isPartOf":{"@id":"http:\/\/43.205.93.38\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/#primaryimage"},"image":{"@id":"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/#primaryimage"},"thumbnailUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1645186740922-Create%20linked%20list_Artboard%201.png","datePublished":"2021-08-03T09:56:49+00:00","dateModified":"2023-07-24T06:41:15+00:00","description":"Learn to create a linked list in the simplest way from a given array. This blog explains how easily you can create a linked list from a given array of elements.","breadcrumb":{"@id":"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/#primaryimage","url":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1645186740922-Create%20linked%20list_Artboard%201.png","contentUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1645186740922-Create%20linked%20list_Artboard%201.png"},{"@type":"BreadcrumbList","@id":"https:\/\/prepbytes.com\/blog\/create-linked-list-from-a-given-array\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/43.205.93.38\/"},{"@type":"ListItem","position":2,"name":"Linked list articles","item":"https:\/\/prepbytes.com\/blog\/category\/linked-list\/"},{"@type":"ListItem","position":3,"name":"Create Linked List From A Given Array"}]},{"@type":"WebSite","@id":"http:\/\/43.205.93.38\/#website","url":"http:\/\/43.205.93.38\/","name":"PrepBytes Blog","description":"ONE-STOP RESOURCE FOR EVERYTHING RELATED TO CODING","publisher":{"@id":"http:\/\/43.205.93.38\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/43.205.93.38\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/43.205.93.38\/#organization","name":"Prepbytes","url":"http:\/\/43.205.93.38\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/","url":"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp","contentUrl":"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp","width":160,"height":160,"caption":"Prepbytes"},"image":{"@id":"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/prepbytes0211\/","https:\/\/www.instagram.com\/prepbytes\/","https:\/\/www.linkedin.com\/company\/prepbytes\/","https:\/\/www.youtube.com\/channel\/UC0xGnHDrjUM1pDEK2Ka5imA"]},{"@type":"Person","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/39fcf072e04987f16796546f2ca83c2e","name":"PrepBytes","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/850669d326db1e1531f04db0c63145d941c2a26792aaeee226a9e6675b0ac698?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/850669d326db1e1531f04db0c63145d941c2a26792aaeee226a9e6675b0ac698?s=96&d=mm&r=g","caption":"PrepBytes"},"url":"https:\/\/prepbytes.com\/blog\/author\/prepbytes\/"}]}},"_links":{"self":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/3499","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/comments?post=3499"}],"version-history":[{"count":7,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/3499\/revisions"}],"predecessor-version":[{"id":17309,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/3499\/revisions\/17309"}],"wp:attachment":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/media?parent=3499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/categories?post=3499"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/tags?post=3499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}