{"id":279,"date":"2025-06-13T13:35:46","date_gmt":"2025-06-13T08:05:46","guid":{"rendered":"https:\/\/codeanddebug.in\/blog\/?p=279"},"modified":"2025-07-07T20:01:35","modified_gmt":"2025-07-07T14:31:35","slug":"insertion-sort-algorithm-explained-in-python","status":"publish","type":"post","link":"https:\/\/codeanddebug.in\/blog\/insertion-sort-algorithm-explained-in-python\/","title":{"rendered":"Insertion Sort Algorithm | Explained in Python"},"content":{"rendered":"\n<p>Master insertion sort step by step. See how each element \u201cinserts\u201d into its correct place, watch a detailed dry run, and review commented Python code, intuition, and Big-O costs.<\/p>\n\n\n\n<p>So let&#8217;s get started with the [<strong><a href=\"https:\/\/www.geeksforgeeks.org\/problems\/insertion-sort\/0\" target=\"_blank\" rel=\"noreferrer noopener\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\"><span style=\"text-decoration: underline;\">Problem Link<\/span><\/mark><\/a><\/strong>].<\/p>\n\n\n<div style=\"max-width: -moz-fit-content; \" class=\"wp-block-ub-table-of-contents-block ub_table-of-contents ub_table-of-contents-collapsed\" id=\"ub_table-of-contents-71b9f97e-b88d-4fe5-8105-f25a7739f590\" data-linktodivider=\"false\" data-showtext=\"show\" data-hidetext=\"hide\" data-scrolltype=\"auto\" data-enablesmoothscroll=\"true\" data-initiallyhideonmobile=\"false\" data-initiallyshow=\"false\"><div class=\"ub_table-of-contents-header-container\" style=\"\">\n\t\t\t<div class=\"ub_table-of-contents-header\" style=\"text-align: left; \">\n\t\t\t\t<div class=\"ub_table-of-contents-title\">Contents:<\/div>\n\t\t\t\t<div class=\"ub_table-of-contents-header-toggle\">\n\t\t\t<div class=\"ub_table-of-contents-toggle\" style=\"\">\n\t\t\t\u00a0[<a class=\"ub_table-of-contents-toggle-link\" href=\"#\" style=\"\">show<\/a>]\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div><div class=\"ub_table-of-contents-extra-container\" style=\"\">\n\t\t\t<div class=\"ub_table-of-contents-container ub_table-of-contents-1-column ub-hide\">\n\t\t\t\t<ul style=\"\"><li style=\"\"><a href=\"https:\/\/codeanddebug.in\/blog\/insertion-sort-algorithm-explained-in-python\/#0-1-what-does-the-algorithm-do\" style=\"\">1. What does the algorithm do?<\/a><\/li><li style=\"\"><a href=\"https:\/\/codeanddebug.in\/blog\/insertion-sort-algorithm-explained-in-python\/#1-2-quick-examples\" style=\"\">2. Quick examples<\/a><\/li><li style=\"\"><a href=\"https:\/\/codeanddebug.in\/blog\/insertion-sort-algorithm-explained-in-python\/#2-3-intuition-amp-approach\" style=\"\">3. Intuition &amp; approach<\/a><ul><li style=\"\"><a href=\"https:\/\/codeanddebug.in\/blog\/insertion-sort-algorithm-explained-in-python\/#3-31-inner-picture\" style=\"\">3.1 Inner picture<\/a><\/li><li style=\"\"><a href=\"https:\/\/codeanddebug.in\/blog\/insertion-sort-algorithm-explained-in-python\/#4-32-why-it-works\" style=\"\">3.2 Why it works<\/a><\/li><li style=\"\"><a href=\"https:\/\/codeanddebug.in\/blog\/insertion-sort-algorithm-explained-in-python\/#5-33-when-is-it-useful\" style=\"\">3.3 When is it useful?<\/a><\/li><\/ul><\/li><li style=\"\"><a href=\"https:\/\/codeanddebug.in\/blog\/insertion-sort-algorithm-explained-in-python\/#6-4-python-code\" style=\"\">4. Python code<\/a><\/li><li style=\"\"><a href=\"https:\/\/codeanddebug.in\/blog\/insertion-sort-algorithm-explained-in-python\/#7-5-step-by-step-code-explanation\" style=\"\">5. Step-by-step code explanation<\/a><\/li><li style=\"\"><a href=\"https:\/\/codeanddebug.in\/blog\/insertion-sort-algorithm-explained-in-python\/#8-6-complexity\" style=\"\">6. Complexity<\/a><\/li><li style=\"\"><a href=\"https:\/\/codeanddebug.in\/blog\/insertion-sort-algorithm-explained-in-python\/#9-7-conclusion\" style=\"\">7. Conclusion<\/a><\/li><\/ul>\n\t\t\t<\/div>\n\t\t<\/div><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"0-1-what-does-the-algorithm-do\">1. What does the algorithm do?<\/h2>\n\n\n\n<p>Insertion sort takes an array and builds the <strong>sorted<\/strong> list one item at a time, always keeping the left side already sorted.<\/p>\n\n\n\n<p>Think about sorting a hand of playing cards:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>You look at the next card.<\/li>\n\n\n\n<li>You slide it left until it sits in the correct spot among the cards you have already arranged.<\/li>\n\n\n\n<li>Repeat until all cards are placed.<\/li>\n<\/ol>\n\n\n\n<p>That is exactly how insertion sort works on numbers.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"1-2-quick-examples\">2. Quick examples<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Input array<\/th><th>Sorted output<\/th><th>How it happens<\/th><\/tr><\/thead><tbody><tr><td><code>[4, 3, 1, 2]<\/code><\/td><td><code>[1, 2, 3, 4]<\/code><\/td><td>4 \u2714 \u2192 insert 3 before 4 \u2192 insert 1 before 3 \u2192 insert 2 between 1 and 3<\/td><\/tr><tr><td><code>[1, 2, 3, 4]<\/code><\/td><td><code>[1, 2, 3, 4]<\/code><\/td><td>Already sorted, each element stays in place (best case).<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"2-3-intuition-amp-approach\">3. Intuition &amp; approach<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-31-inner-picture\">3.1 Inner picture<\/h3>\n\n\n\n<p>Imagine a vertical <em>divider<\/em> that separates the <strong>sorted<\/strong> left part from the <strong>unsorted<\/strong> right part.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"[  sorted   |   unsorted  ]\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D4D4D4\">[  <\/span><span style=\"color: #DCDCAA\">sorted<\/span><span style=\"color: #D4D4D4\">   |   unsorted  ]<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The divider starts after the first element (because a single item is trivially sorted).<\/li>\n\n\n\n<li>Each pass picks the first element in the unsorted side (<code>key<\/code>).<\/li>\n\n\n\n<li>Slide that <code>key<\/code> left, shifting bigger elements right, until you find its correct spot.<\/li>\n\n\n\n<li>Move the divider one step to the right and repeat.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"4-32-why-it-works\">3.2 Why it works<\/h3>\n\n\n\n<p>The algorithm maintains the <strong>loop invariant<\/strong>:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u201cElements to the left of <code>i<\/code> are always in non-decreasing order.\u201d<\/p>\n<\/blockquote>\n\n\n\n<p>After the final pass, the divider is at the very end, thus the whole array is sorted.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"5-33-when-is-it-useful\">3.3 When is it useful?<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Small input sizes (the simple logic beats heavier algorithms).<\/li>\n\n\n\n<li>Lists that are <em>almost<\/em> sorted, Time Complexity drops to <em>O(n)<\/em> because the inner while-loop rarely runs.<\/li>\n\n\n\n<li>Situations where <strong>stability<\/strong> and <strong>in-place<\/strong> memory (<code>O(1)<\/code>) are required.<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><em>Read about the Python Program to <strong><a href=\"https:\/\/codeanddebug.in\/blog\/python-program-for-selection-sort-algorithm\/\" data-type=\"post\" data-id=\"68\" target=\"_blank\" rel=\"noreferrer noopener\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\"><span style=\"text-decoration: underline;\">Implement Selection Sort Algorithm<\/span><\/mark><\/a><\/strong>.<\/em><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"6-4-python-code\">4. Python code<\/h2>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"# Please change the array in-place\nclass Solution:\n    def insertionSort(self, arr):\n        # Start from the second element; first element is a sorted sub-array of length 1\n        for i in range(1, len(arr)):\n            key = arr[i]        # element we want to insert\n            j = i - 1           # index that scans the sorted part (left side)\n    \n            # Shift larger elements one step to the right\n            while j &gt;= 0 and arr[j] &gt; key:\n                arr[j + 1] = arr[j]\n                j -= 1\n    \n            # Place 'key' into its correct spot\n            arr[j + 1] = key\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6A9955\"># Please change the array in-place<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">class<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4EC9B0\">Solution<\/span><span style=\"color: #D4D4D4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #569CD6\">def<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">insertionSort<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">self<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #9CDCFE\">arr<\/span><span style=\"color: #D4D4D4\">):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #6A9955\"># Start from the second element; first element is a sorted sub-array of length 1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #C586C0\">for<\/span><span style=\"color: #D4D4D4\"> i <\/span><span style=\"color: #C586C0\">in<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">range<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #DCDCAA\">len<\/span><span style=\"color: #D4D4D4\">(arr)):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            key = arr[i]        <\/span><span style=\"color: #6A9955\"># element we want to insert<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            j = i - <\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">           <\/span><span style=\"color: #6A9955\"># index that scans the sorted part (left side)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            <\/span><span style=\"color: #6A9955\"># Shift larger elements one step to the right<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            <\/span><span style=\"color: #C586C0\">while<\/span><span style=\"color: #D4D4D4\"> j &gt;= <\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">and<\/span><span style=\"color: #D4D4D4\"> arr[j] &gt; key:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">                arr[j + <\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">] = arr[j]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">                j -= <\/span><span style=\"color: #B5CEA8\">1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            <\/span><span style=\"color: #6A9955\"># Place &#39;key&#39; into its correct spot<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            arr[j + <\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">] = key<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"7-5-step-by-step-code-explanation\">5. Step-by-step code explanation<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Outer <code>for<\/code> loop (<code>i<\/code> from 1 to n-1).<\/strong><br><code>i<\/code> marks the boundary between sorted and unsorted parts.<\/li>\n\n\n\n<li><strong><code>key = arr[i]<\/code>.<\/strong><br>Save the element to be inserted.<\/li>\n\n\n\n<li><strong>Inner <code>while<\/code> loop.<\/strong>\n<ul class=\"wp-block-list\">\n<li><code>j<\/code> walks left across the sorted section.<\/li>\n\n\n\n<li>As long as <code>arr[j]<\/code> is bigger than <code>key<\/code>, shift <code>arr[j]<\/code> one cell to the right.<\/li>\n\n\n\n<li>Stop when you find a number \u2264 <code>key<\/code> or hit the array\u2019s start.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Insert <code>key<\/code>.<\/strong><br>The correct position for <code>key<\/code> is just to the right of where the loop stopped (<code>j + 1<\/code>).<\/li>\n\n\n\n<li><strong>Repeat<\/strong> until the entire array is processed.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"8-6-complexity\">6. Complexity<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Case<\/th><th>Time<\/th><th>Why<\/th><\/tr><\/thead><tbody><tr><td><strong>Worst \/ Average<\/strong><\/td><td><strong>O(n\u00b2)<\/strong><\/td><td>In reversed or random arrays, each new <code>key<\/code> may scan almost the whole sorted part.<\/td><\/tr><tr><td><strong>Best<\/strong><\/td><td><strong>O(n)<\/strong><\/td><td>If the array is already sorted, the <code>while<\/code> test fails immediately every time.<\/td><\/tr><tr><td><strong>Space<\/strong><\/td><td><strong>O(1)<\/strong><\/td><td>Sort happens in place; only a few variables (<code>key<\/code>, <code>i<\/code>, <code>j<\/code>).<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"9-7-conclusion\">7. Conclusion<\/h2>\n\n\n\n<p>Insertion sort is:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Simple<\/strong> \u2013 only two loops and a handful of variables.<\/li>\n\n\n\n<li><strong>Stable &amp; in-place<\/strong> \u2013 keeps equal items in original order using no extra memory.<\/li>\n\n\n\n<li><strong>Efficient for small or nearly-sorted data<\/strong>, though it scales quadratically in the worst case.<\/li>\n<\/ul>\n\n\n\n<p>Remember the card-sorting analogy, and you\u2019ll always recall how insertion sort inserts each element into its proper place.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-16018d1d wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/www.codeanddebug.in\/course\/zero-to-hero-python-dsa\">Join our Advance DSA COURSE<\/a><\/div>\n<\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><em>For any changes to the article, kindly email at <a href=\"mailto:code@codeanddebug.in\">code@codeanddebug.in<\/a> or contact us at <a href=\"tel:+91-9712928220\">+91-9712928220<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Master insertion sort step by step. See how each element \u201cinserts\u201d into its correct place, watch a detailed dry run, and review commented Python code, intuition, and Big-O costs. So let&#8217;s get started with the [Problem Link]. 1. What does the algorithm do? Insertion sort takes an array and builds the sorted list one item<\/p>\n","protected":false},"author":1,"featured_media":294,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ub_ctt_via":"","footnotes":""},"categories":[3,4],"tags":[12],"class_list":{"0":"post-279","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-structures-and-algorithm","8":"category-beginner","9":"tag-sorting-algos"},"featured_image_src":"https:\/\/codeanddebug.in\/blog\/wp-content\/uploads\/2025\/06\/insertion-sort-featured-image.png","author_info":{"display_name":"codeanddebug","author_link":"https:\/\/codeanddebug.in\/blog\/author\/codeanddebug\/"},"_links":{"self":[{"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/posts\/279","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/comments?post=279"}],"version-history":[{"count":5,"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/posts\/279\/revisions"}],"predecessor-version":[{"id":549,"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/posts\/279\/revisions\/549"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/media\/294"}],"wp:attachment":[{"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/media?parent=279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/categories?post=279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeanddebug.in\/blog\/wp-json\/wp\/v2\/tags?post=279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}