{"id":134,"date":"2013-08-29T15:35:33","date_gmt":"2013-08-29T22:35:33","guid":{"rendered":"http:\/\/samueldotj.com\/blog\/?p=134"},"modified":"2013-08-29T15:35:33","modified_gmt":"2013-08-29T22:35:33","slug":"fix-loop-in-a-linked-list","status":"publish","type":"post","link":"http:\/\/samueldotj.com\/blog\/fix-loop-in-a-linked-list\/","title":{"rendered":"Fix loop in a linked list"},"content":{"rendered":"<p>Cycle or loop in a linked list with <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-9f9c792f3d1c0d436f1e9ae9ff2e4949_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"10\" style=\"vertical-align: 0px;\"\/> nodes is shown in pictorial representation.<br \/>\n<div id=\"attachment_138\" style=\"width: 310px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/samueldotj.com\/blog\/wp-content\/uploads\/2013\/08\/Cycle.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-138\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/uploads\/2013\/08\/Cycle-300x65.png\" alt=\"Loop in a singly linked list\" width=\"300\" height=\"65\" class=\"size-medium wp-image-138\" srcset=\"http:\/\/samueldotj.com\/blog\/wp-content\/uploads\/2013\/08\/Cycle-300x65.png 300w, http:\/\/samueldotj.com\/blog\/wp-content\/uploads\/2013\/08\/Cycle.png 583w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-138\" class=\"wp-caption-text\">Loop in a singly linked list<\/p><\/div><\/p>\n<p>In this picture the number of nodes in the list is <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-9f9c792f3d1c0d436f1e9ae9ff2e4949_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"10\" style=\"vertical-align: 0px;\"\/> and the last node points to node at a position x(which created the cycle). From the picture it is obvious that to fix the loop:<\/p>\n<ol>\n<li>Find the last element<\/li>\n<li>Correct it to point end(NULL)<\/li>\n<\/ol>\n<p>In the above steps, step 1(find the last element) is little difficult if total number of nodes in the list is <strong>unknown<\/strong>. In this post I will describe a method I discovered to find the last node. I drew couple of pictures to explain the complexity of the problem. The following pictures explains the same loop condition but in different form. It explains why it is hard to find the last node.<br \/>\n<a href=\"http:\/\/samueldotj.com\/blog\/wp-content\/uploads\/2013\/08\/Cycle2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/uploads\/2013\/08\/Cycle2.png\" alt=\"Cycle2\" width=\"635\" height=\"91\" class=\"alignnone size-full wp-image-151\" srcset=\"http:\/\/samueldotj.com\/blog\/wp-content\/uploads\/2013\/08\/Cycle2.png 635w, http:\/\/samueldotj.com\/blog\/wp-content\/uploads\/2013\/08\/Cycle2-300x42.png 300w\" sizes=\"auto, (max-width: 635px) 100vw, 635px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/samueldotj.com\/blog\/wp-content\/uploads\/2013\/08\/Cycle3.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/uploads\/2013\/08\/Cycle3.png\" alt=\"Cycle3\" width=\"469\" height=\"108\" class=\"alignnone size-full wp-image-152\" srcset=\"http:\/\/samueldotj.com\/blog\/wp-content\/uploads\/2013\/08\/Cycle3.png 469w, http:\/\/samueldotj.com\/blog\/wp-content\/uploads\/2013\/08\/Cycle3-300x69.png 300w\" sizes=\"auto, (max-width: 469px) 100vw, 469px\" \/><\/a><br \/>\nThe illustration also tells us the following<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-9b30a924495e1f93eff66310347f2ac0_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#110;&#32;&#61;&#32;&#120;&#43;&#121;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"71\" style=\"vertical-align: -3px;\"\/><br \/>\nwhere<br \/>\n&nbsp; <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-9f9c792f3d1c0d436f1e9ae9ff2e4949_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"10\" style=\"vertical-align: 0px;\"\/> is total number of nodes in the list<br \/>\n&nbsp; <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-8aa17fa6615962eb1a747b73bcc92f80_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"9\" style=\"vertical-align: 0px;\"\/> is number of nodes before the cycle starts.<br \/>\n&nbsp; <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-5f08a280df35506f9363e0d1703cd851_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#121;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"9\" style=\"vertical-align: -3px;\"\/> is number of nodes forming the cycle.<\/p>\n<p>If we have value of <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-8aa17fa6615962eb1a747b73bcc92f80_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"9\" style=\"vertical-align: 0px;\"\/> and <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-5f08a280df35506f9363e0d1703cd851_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#121;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"9\" style=\"vertical-align: -3px;\"\/> then the equation can be solved, which will give the last node\u2019s location.<\/p>\n<p><strong>Finding <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-5f08a280df35506f9363e0d1703cd851_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#121;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"9\" style=\"vertical-align: -3px;\"\/><\/strong><\/p>\n<ol>\n<li>Detect the cycle using Floyd\u2019s Cycle detection algorithm. (Two pointer with varying speed)<\/li>\n<li>When cycle is detected\n<ol>\n<li>Store the current node as H<\/li>\n<li>Move to next node and increment y(y++)<\/li>\n<li>If current node is H then exit<\/li>\n<li>Goto step 2<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p><strong>Finding <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-8aa17fa6615962eb1a747b73bcc92f80_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"9\" style=\"vertical-align: 0px;\"\/><\/strong><br \/>\nLet\u2019s first see the easiest way to solve this:<\/p>\n<ol>\n<li>Have two pointers (p1, p2)<\/li>\n<li>p1 = node 0<\/li>\n<li>p2 = p1 + y nodes<\/li>\n<li>if p1 == p2 then we found the result is <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-6f2ecc48c4d5bf5138ee701167a61b2d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;&#32;&#61;&#32;&#112;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"15\" width=\"47\" style=\"vertical-align: -3px;\"\/><\/li>\n<li>p1 = p1 + y nodes<\/li>\n<li>goto step 3.<\/li>\n<\/ol>\n<p>The complexity of this algorithm linear depends on <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-8aa17fa6615962eb1a747b73bcc92f80_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"9\" style=\"vertical-align: 0px;\"\/>. For example if <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-8aa17fa6615962eb1a747b73bcc92f80_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"9\" style=\"vertical-align: 0px;\"\/> is 10K and <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-5f08a280df35506f9363e0d1703cd851_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#121;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"9\" style=\"vertical-align: -3px;\"\/> is 2 then number of node visits are > 20K. In other words the complexity is <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-be009ed84c5dbef8c9da4e0ab80612af_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#79;&#40;&#50;&#120;&#32;&#43;&#32;&#121;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"72\" style=\"vertical-align: -4px;\"\/>.<\/p>\n<p>I believe it can be done in <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-f17985b51fa15d9e24ccb364fde3fe90_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#79;&#40;&#110;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"34\" style=\"vertical-align: -4px;\"\/> or <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-5a4d08945942ad313f7a743439496291_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#79;&#40;&#120;&#32;&#43;&#32;&#121;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"63\" style=\"vertical-align: -4px;\"\/> with following method This following diagram captures state when the &#8220;tortoise and the hare&#8221; algorithm detects the cycle.<br \/>\n<a href=\"http:\/\/samueldotj.com\/blog\/wp-content\/uploads\/2013\/08\/CycleFix1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/uploads\/2013\/08\/CycleFix1.png\" alt=\"CycleFix\" width=\"506\" height=\"130\" class=\"alignnone size-full wp-image-159\" srcset=\"http:\/\/samueldotj.com\/blog\/wp-content\/uploads\/2013\/08\/CycleFix1.png 506w, http:\/\/samueldotj.com\/blog\/wp-content\/uploads\/2013\/08\/CycleFix1-300x77.png 300w\" sizes=\"auto, (max-width: 506px) 100vw, 506px\" \/><\/a><\/p>\n<p>Lets define few more variables at the time of cycle detection:<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-2f2cb00cf96aa920ab1041073bf8ad6a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#84;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"12\" style=\"vertical-align: 0px;\"\/> is the total number of nodes tortoise traveled.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-a6f2b49d15c8a555a5b861c560881b92_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#72;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"15\" style=\"vertical-align: 0px;\"\/> is the total number of nodes hare traveled.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-2650c16c3c9e38aa51f9867a23890025_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#114;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"8\" style=\"vertical-align: 0px;\"\/> can be defined as number of nodes before the &#8216;last node&#8217;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-c70da08357ecd9bf6af83d7b204b158d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#84;&#32;&#61;&#32;&#50;&#72;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#110;&#101;&#119;&#108;&#105;&#110;&#101; &#120;&#32;&#43;&#32;&#99;&#121;&#32;&#45;&#32;&#114;&#32;&#61;&#32;&#84;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#110;&#101;&#119;&#108;&#105;&#110;&#101; &#120;&#32;&#43;&#32;&#121;&#32;&#45;&#32;&#114;&#32;&#61;&#32;&#72;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#110;&#101;&#119;&#108;&#105;&#110;&#101;\" title=\"Rendered by QuickLaTeX.com\" height=\"56\" width=\"108\" style=\"vertical-align: 18px;\"\/><br \/>\nwhere c is the number of complete cycles hare covered.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-e517549f49202880dd0ee979796fe948_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#84;&#32;&#62;&#32;&#72;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#110;&#101;&#119;&#108;&#105;&#110;&#101; &#99;&#32;&#62;&#32;&#49;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#110;&#101;&#119;&#108;&#105;&#110;&#101; &#114;&#32;&#62;&#61;&#32;&#120;&#32;&#92;&#32;&#97;&#110;&#100;&#32;&#92;&#32;&#114;&#32;&#60;&#61;&#32;&#110;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#110;&#101;&#119;&#108;&#105;&#110;&#101;\" title=\"Rendered by QuickLaTeX.com\" height=\"52\" width=\"144\" style=\"vertical-align: 21px;\"\/><br \/>\nFrom this we can derive<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-322906623d83aeb0b7cd20ba5f67f2ea_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#99;&#32;&#61;&#32;&#72;&#32;&#47;&#32;&#121;&#32;&#43;&#32;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"88\" style=\"vertical-align: -4px;\"\/><\/p>\n<p>Using value of <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-9fbeb23be22f99c93f330d0033c50568_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#99;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"8\" style=\"vertical-align: 0px;\"\/>, <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-2650c16c3c9e38aa51f9867a23890025_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#114;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"8\" style=\"vertical-align: 0px;\"\/> can be derived.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-cb01f9fc40f4d1767f4ea1db4dd72fc4_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;&#32;&#43;&#32;&#121;&#32;&#45;&#32;&#114;&#32;&#61;&#32;&#72;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#110;&#101;&#119;&#108;&#105;&#110;&#101; &#114;&#32;&#61;&#32;&#120;&#32;&#43;&#32;&#121;&#32;&#45;&#32;&#72;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#110;&#101;&#119;&#108;&#105;&#110;&#101; &#92;&#110;&#101;&#119;&#108;&#105;&#110;&#101; &#120;&#32;&#43;&#32;&#99;&#121;&#32;&#45;&#32;&#114;&#32;&#61;&#32;&#84;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#110;&#101;&#119;&#108;&#105;&#110;&#101; &#120;&#32;&#61;&#32;&#32;&#84;&#32;&#45;&#32;&#99;&#121;&#32;&#43;&#32;&#114;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#110;&#101;&#119;&#108;&#105;&#110;&#101; &#92;&#110;&#101;&#119;&#108;&#105;&#110;&#101; &#114;&#32;&#61;&#32;&#32;&#84;&#32;&#45;&#32;&#99;&#121;&#32;&#43;&#32;&#114;&#32;&#32;&#43;&#32;&#32;&#121;&#32;&#45;&#32;&#72;&#32;&#32;&#92;&#110;&#101;&#119;&#108;&#105;&#110;&#101; &#114;&#32;&#61;&#32;&#32;&#72;&#32;&#45;&#32;&#99;&#121;&#32;&#43;&#32;&#114;&#32;&#32;&#43;&#32;&#32;&#121;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#110;&#101;&#119;&#108;&#105;&#110;&#101;\" title=\"Rendered by QuickLaTeX.com\" height=\"159\" width=\"171\" style=\"vertical-align: 18px;\"\/><\/p>\n<p>Using this formula <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-2650c16c3c9e38aa51f9867a23890025_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#114;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"8\" style=\"vertical-align: 0px;\"\/> can be found. With this <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-2650c16c3c9e38aa51f9867a23890025_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#114;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"8\" style=\"vertical-align: 0px;\"\/> value, the last node can be found by travelling <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/samueldotj.com\/blog\/wp-content\/ql-cache\/quicklatex.com-0dfe30d9edc6651a2b70a0afb7f6828f_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#114;&#45;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"35\" style=\"vertical-align: -1px;\"\/> nodes where T and H met.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cycle or loop in a linked list with nodes is shown in pictorial representation. In this picture the number of nodes in the list is and the last node points to node at a position x(which created the cycle). From the picture it is obvious that to fix the loop: Find the last element Correct [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-134","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/samueldotj.com\/blog\/wp-json\/wp\/v2\/posts\/134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/samueldotj.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/samueldotj.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/samueldotj.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/samueldotj.com\/blog\/wp-json\/wp\/v2\/comments?post=134"}],"version-history":[{"count":10,"href":"http:\/\/samueldotj.com\/blog\/wp-json\/wp\/v2\/posts\/134\/revisions"}],"predecessor-version":[{"id":177,"href":"http:\/\/samueldotj.com\/blog\/wp-json\/wp\/v2\/posts\/134\/revisions\/177"}],"wp:attachment":[{"href":"http:\/\/samueldotj.com\/blog\/wp-json\/wp\/v2\/media?parent=134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/samueldotj.com\/blog\/wp-json\/wp\/v2\/categories?post=134"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/samueldotj.com\/blog\/wp-json\/wp\/v2\/tags?post=134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}