{"id":15698,"date":"2025-09-12T08:44:06","date_gmt":"2025-09-12T08:44:06","guid":{"rendered":"https:\/\/www.kaashivinfotech.com\/blog\/?p=15698"},"modified":"2025-09-12T08:44:06","modified_gmt":"2025-09-12T08:44:06","slug":"insertion-sort-algorithm-examples","status":"publish","type":"post","link":"https:\/\/www.kaashivinfotech.com\/blog\/insertion-sort-algorithm-examples\/","title":{"rendered":"\ud83d\ude80 Insertion Sort Algorithm in 2025 \u2013 Must-Know Facts, Examples in C, Java, Python &#038; More"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>Sorting algorithms are everywhere \u2014 in your search results, your playlists, and even in the way your favorite e-commerce app recommends products. And if you\u2019re preparing for coding interviews in <strong>2025<\/strong>, one algorithm you can\u2019t skip is the <strong>insertion sort algorithm<\/strong>.<\/p>\n<p>Yes, it\u2019s basic. Yes, it\u2019s old. But here\u2019s the catch: recruiters still love asking about it because it tests your fundamentals in <strong>data structures<\/strong> and helps them see how you approach problems.<\/p>\n<p>This guide isn\u2019t just another copy-paste explanation. You\u2019ll walk away with:<br \/>\n\u2705 A crystal-clear understanding of <strong>insertion sort in data structure<\/strong><br \/>\n\u2705 Step-by-step dry runs you can explain in interviews<br \/>\n\u2705 Implementations in <strong>C, C++, Java, Python, and JavaScript<\/strong><br \/>\n\u2705 Real-world use cases (where insertion sort still shines in 2025)<br \/>\n\u2705 Advantages, disadvantages, and best practices for your career<\/p>\n<p>Let\u2019s dive in.<\/p>\n<hr \/>\n<h2>\ud83d\udd11 Key Highlights<\/h2>\n<ul>\n<li><strong>Insertion sort algorithm<\/strong> works like sorting playing cards in your hand.<\/li>\n<li>It\u2019s <strong>efficient for small or nearly-sorted datasets<\/strong> but not for huge ones.<\/li>\n<li><strong>Time complexity<\/strong>: O(n\u00b2) worst case, O(n) best case.<\/li>\n<li>Code examples in <strong>C, Java, Python, and JavaScript<\/strong>.<\/li>\n<li><strong>Stable<\/strong> algorithm \u2192 preserves the order of equal elements.<\/li>\n<li>Still relevant in <strong>real-world apps<\/strong> like embedded systems &amp; linked lists.<\/li>\n<\/ul>\n<hr \/>\n<h2>\ud83e\udd14 What is Insertion Sort Algorithm?<\/h2>\n<p>The <strong>insertion sort algorithm<\/strong> is one of the simplest ways to sort data. Think about the last time you sorted playing cards in your hand. You picked one card at a time and placed it in the right spot. That\u2019s insertion sort in a nutshell.<\/p>\n<p>Technically, it:<\/p>\n<ul>\n<li>Builds a <strong>sorted sublist<\/strong> one element at a time.<\/li>\n<li>Takes the next unsorted element and <strong>inserts it<\/strong> into the correct position by shifting larger elements to the right.<\/li>\n<li>Works <strong>in-place<\/strong> (doesn\u2019t need extra memory).<\/li>\n<\/ul>\n<p>\ud83d\udc49 That\u2019s why in computer science classes, insertion sort is often the <strong>first sorting algorithm taught<\/strong> \u2014 it\u2019s easy to visualize and code.<\/p>\n<hr \/>\n<h2>\ud83d\udee0\ufe0f How Insertion Sort in Data Structure Works (Step by Step)<\/h2>\n<p>Let\u2019s dry-run insertion sort on this array:<\/p>\n<pre><code class=\"\" data-line=\"\">[5, 2, 9, 1]\n<\/code><\/pre>\n<p>Step-by-step:<\/p>\n<ol>\n<li>Start with 5 \u2192 already sorted.<\/li>\n<li>Take 2 \u2192 compare with 5, place before it \u2192 <code class=\"\" data-line=\"\">[2, 5, 9, 1]<\/code>.<\/li>\n<li>Take 9 \u2192 bigger than 5, so it stays \u2192 <code class=\"\" data-line=\"\">[2, 5, 9, 1]<\/code>.<\/li>\n<li>Take 1 \u2192 shift 9, 5, 2 to the right, insert 1 at the start \u2192 <code class=\"\" data-line=\"\">[1, 2, 5, 9]<\/code>.<\/li>\n<\/ol>\n<p>\ud83d\udca1 Developers often say this algorithm feels \u201cmanual\u201d because you see every move \u2014 unlike quicksort or mergesort, which feel more abstract.<\/p>\n<figure id=\"attachment_15702\" aria-describedby=\"caption-attachment-15702\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><img fetchpriority=\"high\" decoding=\"async\" class=\"wp-image-15702 size-medium\" src=\"https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Insertion-Sort-300x200.webp\" alt=\"Insertion Sort in Data Structure\" width=\"300\" height=\"200\" srcset=\"https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Insertion-Sort-300x200.webp 300w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Insertion-Sort-1024x683.webp 1024w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Insertion-Sort-768x512.webp 768w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Insertion-Sort-380x253.webp 380w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Insertion-Sort-800x533.webp 800w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Insertion-Sort-1160x773.webp 1160w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Insertion-Sort.webp 1536w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><figcaption id=\"caption-attachment-15702\" class=\"wp-caption-text\">Insertion Sort<\/figcaption><\/figure>\n<hr \/>\n<h2>\ud83d\udcbb Insertion Sort Programs in C, Java, Python &amp; JavaScript<\/h2>\n<h3>\ud83d\udd39 Insertion Sort in C<\/h3>\n<pre><code class=\"language-c\" data-line=\"\">#include &lt;stdio.h&gt;\n\nvoid insertionSort(int arr[], int n) {\n    for (int i = 1; i &lt; n; i++) {\n        int key = arr[i];\n        int j = i - 1;\n        while (j &gt;= 0 &amp;&amp; arr[j] &gt; key) {\n            arr[j + 1] = arr[j];\n            j--;\n        }\n        arr[j + 1] = key;\n    }\n}\n\nint main() {\n    int arr[] = {5, 2, 9, 1};\n    int n = sizeof(arr) \/ sizeof(arr[0]);\n    insertionSort(arr, n);\n    for (int i = 0; i &lt; n; i++) printf(&quot;%d &quot;, arr[i]);\n    return 0;\n}<\/code><\/pre>\n<figure id=\"attachment_15708\" aria-describedby=\"caption-attachment-15708\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-medium wp-image-15708\" src=\"https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Flowchart-of-Insertion-Sort-Algorithm-300x300.webp\" alt=\"Flowchart of Insertion Sort Algorithm\" width=\"300\" height=\"300\" srcset=\"https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Flowchart-of-Insertion-Sort-Algorithm-300x300.webp 300w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Flowchart-of-Insertion-Sort-Algorithm-150x150.webp 150w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Flowchart-of-Insertion-Sort-Algorithm-80x80.webp 80w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Flowchart-of-Insertion-Sort-Algorithm-380x380.webp 380w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Flowchart-of-Insertion-Sort-Algorithm-24x24.webp 24w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Flowchart-of-Insertion-Sort-Algorithm-48x48.webp 48w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Flowchart-of-Insertion-Sort-Algorithm-96x96.webp 96w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Flowchart-of-Insertion-Sort-Algorithm.webp 738w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><figcaption id=\"caption-attachment-15708\" class=\"wp-caption-text\">Flowchart of Insertion Sort Algorithm<\/figcaption><\/figure>\n<hr \/>\n<h3>\ud83d\udd39 Insertion Sort in Java<\/h3>\n<pre><code class=\"language-java\" data-line=\"\">public class InsertionSort {\n    public static void insertionSort(int[] arr) {\n        for (int i = 1; i &lt; arr.length; i++) {\n            int key = arr[i];\n            int j = i - 1;\n            while (j &gt;= 0 &amp;&amp; arr[j] &gt; key) {\n                arr[j + 1] = arr[j];\n                j--;\n            }\n            arr[j + 1] = key;\n        }\n    }\n    public static void main(String[] args) {\n        int[] arr = {5, 2, 9, 1};\n        insertionSort(arr);\n        for (int i : arr) System.out.print(i + &quot; &quot;);\n    }\n}\n<\/code><\/pre>\n<hr \/>\n<h3>\ud83d\udd39 Insertion Sort in Python<\/h3>\n<pre><code class=\"language-python\" data-line=\"\">def insertion_sort(arr):\n    for i in range(1, len(arr)):\n        key = arr[i]\n        j = i - 1\n        while j &gt;= 0 and arr[j] &gt; key:\n            arr[j + 1] = arr[j]\n            j -= 1\n        arr[j + 1] = key\n    return arr\n\nprint(insertion_sort([5, 2, 9, 1]))\n<\/code><\/pre>\n<hr \/>\n<h3>\ud83d\udd39 Insertion Sort in JavaScript<\/h3>\n<pre><code class=\"language-javascript\" data-line=\"\">const insertionSort = (arr) =&gt; {\n  for (let i = 1; i &lt; arr.length; i++) {\n    let currentValue = arr[i];\n    let j = i - 1;\n    while (j &gt;= 0 &amp;&amp; arr[j] &gt; currentValue) {\n      arr[j + 1] = arr[j];\n      j--;\n    }\n    arr[j + 1] = currentValue;\n  }\n  return arr;\n};\n\nconsole.log(insertionSort([5, 2, 9, 1]));\n<\/code><\/pre>\n<hr \/>\n<h2>\u2696\ufe0f Is Insertion Sort Stable?<\/h2>\n<p>Yes \u2705. Stability means if two students have the same marks, their original order (say by roll number) remains unchanged.<\/p>\n<p>This matters in <strong>real-world databases<\/strong> where you might sort employees by salary but still want to keep their hire-date order.<\/p>\n<hr \/>\n<h2>\ud83d\udcca Space &amp; Time complexity of insertion sort<\/h2>\n<ul>\n<li><strong>Best Case<\/strong>: O(n) (when the array is already sorted)<\/li>\n<li><strong>Worst Case<\/strong>: O(n\u00b2) (reverse sorted array)<\/li>\n<li><strong>Average Case<\/strong>: O(n\u00b2)<\/li>\n<\/ul>\n<p><strong>Space Complexity<\/strong>: O(1) \u2192 it sorts in-place.<\/p>\n<p>Here\u2019s a quick comparison:<\/p>\n<table>\n<thead>\n<tr>\n<th>Algorithm<\/th>\n<th>Best Case<\/th>\n<th>Worst Case<\/th>\n<th>Stable<\/th>\n<th>Extra Space<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Insertion Sort<\/td>\n<td>O(n)<\/td>\n<td>O(n\u00b2)<\/td>\n<td>\u2705<\/td>\n<td>O(1)<\/td>\n<\/tr>\n<tr>\n<td>Bubble Sort<\/td>\n<td>O(n)<\/td>\n<td>O(n\u00b2)<\/td>\n<td>\u2705<\/td>\n<td>O(1)<\/td>\n<\/tr>\n<tr>\n<td>Merge Sort<\/td>\n<td>O(n log n)<\/td>\n<td>O(n log n)<\/td>\n<td>\u2705<\/td>\n<td>O(n)<\/td>\n<\/tr>\n<tr>\n<td>Quick Sort<\/td>\n<td>O(n log n)<\/td>\n<td>O(n\u00b2)<\/td>\n<td>\u274c<\/td>\n<td>O(log n)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\ud83d\udc49 According to an MIT study, insertion sort <strong>outperforms quicksort<\/strong> for arrays smaller than ~30 elements.<\/p>\n<figure id=\"attachment_15711\" aria-describedby=\"caption-attachment-15711\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-medium wp-image-15711\" src=\"https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Insertion-Sort-vs-Bubble-Sort-vs-Merge-Sort-Quick-Comparison-300x166.webp\" alt=\"Insertion Sort vs Bubble Sort vs Merge Sort Quick Comparison\" width=\"300\" height=\"166\" srcset=\"https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Insertion-Sort-vs-Bubble-Sort-vs-Merge-Sort-Quick-Comparison-300x166.webp 300w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Insertion-Sort-vs-Bubble-Sort-vs-Merge-Sort-Quick-Comparison-1024x567.webp 1024w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Insertion-Sort-vs-Bubble-Sort-vs-Merge-Sort-Quick-Comparison-768x425.webp 768w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Insertion-Sort-vs-Bubble-Sort-vs-Merge-Sort-Quick-Comparison-380x210.webp 380w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Insertion-Sort-vs-Bubble-Sort-vs-Merge-Sort-Quick-Comparison-800x443.webp 800w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Insertion-Sort-vs-Bubble-Sort-vs-Merge-Sort-Quick-Comparison-1160x642.webp 1160w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Insertion-Sort-vs-Bubble-Sort-vs-Merge-Sort-Quick-Comparison.webp 1291w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><figcaption id=\"caption-attachment-15711\" class=\"wp-caption-text\">Insertion Sort vs Bubble Sort vs Merge Sort Quick Comparison<\/figcaption><\/figure>\n<hr \/>\n<h2>\ud83c\udf0d Real-World Use Cases of Insertion Sort in 2025<\/h2>\n<p>Despite being \u201cslow\u201d on paper, insertion sort still has practical uses:<\/p>\n<ul>\n<li><strong>Embedded systems<\/strong>: where memory is limited.<\/li>\n<li><strong>Partially sorted datasets<\/strong>: like user logs that are mostly in order.<\/li>\n<li><strong>Small input sizes<\/strong>: config files, sorting player scores in a game.<\/li>\n<li><strong>Linked lists<\/strong>: insertion is cheaper here compared to arrays.<\/li>\n<\/ul>\n<p>\ud83d\udca1 Career insight: Startups often use insertion sort as a quick solution before switching to heavier algorithms when scaling.<\/p>\n<figure id=\"attachment_15712\" aria-describedby=\"caption-attachment-15712\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-15712\" src=\"https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Real-World-Use-Cases-of-Insertion-Sort-in-2025-300x300.webp\" alt=\"Real-World Use Cases of Insertion Sort in 2025\" width=\"300\" height=\"300\" srcset=\"https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Real-World-Use-Cases-of-Insertion-Sort-in-2025-300x300.webp 300w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Real-World-Use-Cases-of-Insertion-Sort-in-2025-150x150.webp 150w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Real-World-Use-Cases-of-Insertion-Sort-in-2025-768x768.webp 768w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Real-World-Use-Cases-of-Insertion-Sort-in-2025-80x80.webp 80w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Real-World-Use-Cases-of-Insertion-Sort-in-2025-380x380.webp 380w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Real-World-Use-Cases-of-Insertion-Sort-in-2025-800x800.webp 800w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Real-World-Use-Cases-of-Insertion-Sort-in-2025-24x24.webp 24w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Real-World-Use-Cases-of-Insertion-Sort-in-2025-48x48.webp 48w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Real-World-Use-Cases-of-Insertion-Sort-in-2025-96x96.webp 96w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2025\/09\/Real-World-Use-Cases-of-Insertion-Sort-in-2025.webp 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><figcaption id=\"caption-attachment-15712\" class=\"wp-caption-text\">Real-World Use Cases of Insertion Sort in 2025<\/figcaption><\/figure>\n<hr \/>\n<h2>\u2705 Advantages &amp; Disadvantages<\/h2>\n<p><strong>Advantages<\/strong><\/p>\n<ul>\n<li>Simple to implement and understand.<\/li>\n<li>Great for small or nearly sorted data.<\/li>\n<li>In-place &amp; stable.<\/li>\n<\/ul>\n<p><strong>Disadvantages<\/strong><\/p>\n<ul>\n<li>Not efficient for large datasets.<\/li>\n<li>Performance degrades sharply with input size.<\/li>\n<\/ul>\n<hr \/>\n<h2>\u26a0\ufe0f Common Mistakes Beginners Make<\/h2>\n<ul>\n<li>Using insertion sort on <strong>huge datasets<\/strong> (bad idea).<\/li>\n<li>Forgetting it\u2019s stable (and failing to mention it in interviews).<\/li>\n<li>Misunderstanding its best-case efficiency.<\/li>\n<\/ul>\n<hr \/>\n<h2>\ud83c\udfc6 Best Practices for Using Insertion Sort in 2025<\/h2>\n<ul>\n<li>Use it for <strong>teaching, interviews, and small datasets<\/strong>.<\/li>\n<li>Don\u2019t use it for large data unless you want inefficiency.<\/li>\n<li>Mention <strong>advantages + limitations<\/strong> in interviews \u2014 recruiters love that awareness.<\/li>\n<\/ul>\n<hr \/>\n<h2>\ud83c\udfaf Wrapping Up<\/h2>\n<p>The <strong>insertion sort algorithm<\/strong> may look outdated, but it\u2019s a classic for a reason. It\u2019s stable, intuitive, and still relevant when dealing with <strong>small or partially sorted data<\/strong> in 2025.<\/p>\n<p>If you\u2019re prepping for interviews, here\u2019s a tip: don\u2019t just memorize the code. Be ready to explain <strong>when to use it, when to avoid it, and why stability matters<\/strong>. That\u2019s what separates good developers from great ones.<\/p>\n<hr \/>\n<h2>\ud83d\udcda Related Reads \u2013 Deepen Your Understanding<\/h2>\n<p>Want to explore beyond Insertion Sort? These guides complement <strong>\ud83d\ude80 Insertion Sort Algorithm in 2025 \u2013 Must-Know Facts, Examples in C, Java, Python &amp; More<\/strong> and give you a wider view of sorting &amp; searching algorithms:<\/p>\n<ul>\n<li>\ud83d\udd17 <strong><a href=\"https:\/\/www.kaashivinfotech.com\/blog\/sql-order-by-clause-sql-sort-data\/\">SQL ORDER BY Clause \u2013 Sort Data Like a Pro<\/a><\/strong><br \/>\nPerfect follow-up if you want to see how sorting is applied in databases and real-world data querying.<\/li>\n<li>\ud83d\udd17 <strong><a href=\"https:\/\/www.kaashivinfotech.com\/blog\/insertion-sort-time-complexity-guide\/\">Insertion Sort Time Complexity Guide<\/a><\/strong><br \/>\nDeep dive into the math behind Insertion Sort\u2019s best, average, and worst-case scenarios.<\/li>\n<li>\ud83d\udd17 <strong><a href=\"https:\/\/www.kaashivinfotech.com\/blog\/python-sort-lists-guide\/\">Python Sort Lists Guide<\/a><\/strong><br \/>\nLearn how Python uses Timsort (which includes Insertion Sort for small chunks) to sort lists efficiently.<\/li>\n<li>\ud83d\udd17 <strong><a href=\"https:\/\/www.wikitechy.com\/bubble-sort-algorithm-guide-2025\/\" target=\"_blank\" rel=\"noopener\">Bubble Sort Algorithm Guide (2025)<\/a><\/strong><br \/>\nCompare Insertion Sort with Bubble Sort \u2014 see why one is usually faster and when Bubble Sort might still be useful.<\/li>\n<li>\ud83d\udd17 <strong><a href=\"https:\/\/www.wikitechy.com\/master-merge-sort-algorithm-examples-definition\/\" target=\"_blank\" rel=\"noopener\">Master Merge Sort \u2013 Examples &amp; Definition<\/a><\/strong><br \/>\nExplore Merge Sort, the classic divide-and-conquer approach \u2014 a great contrast to the simplicity of Insertion Sort.<\/li>\n<li>\ud83d\udd17 <strong><a href=\"https:\/\/www.kaashivinfotech.com\/blog\/linear-search-and-binary-search\/\">Linear Search vs Binary Search<\/a><\/strong><br \/>\nSorting is only half the story \u2014 see how searching works on sorted data.<\/li>\n<\/ul>\n<hr \/>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Sorting algorithms are everywhere \u2014 in your search results, your playlists, and even in the way your favorite e-commerce app recommends products. And if you\u2019re preparing for coding interviews in 2025, one algorithm you can\u2019t skip is the insertion sort algorithm. Yes, it\u2019s basic. Yes, it\u2019s old. But here\u2019s the catch: recruiters still love [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":15713,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3453],"tags":[9075,9079,903,9077,9076,1321,9074,1604,9080,1255,1398,8366,9078,5815,5814],"class_list":["post-15698","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-science","tag-algorithm-tutorial","tag-beginner-friendly-algorithms","tag-c-programming","tag-coding-interview-prep","tag-computer-science","tag-data-structures","tag-insertion-sort","tag-java-programming","tag-programming-guide","tag-python-programming","tag-software-engineering","tag-sorting-algorithms","tag-sorting-in-2025","tag-space-complexity","tag-time-complexity"],"_links":{"self":[{"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/posts\/15698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/comments?post=15698"}],"version-history":[{"count":0,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/posts\/15698\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/media\/15713"}],"wp:attachment":[{"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/media?parent=15698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/categories?post=15698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/tags?post=15698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}