{"id":3200,"date":"2025-12-03T15:40:06","date_gmt":"2025-12-03T14:40:06","guid":{"rendered":"https:\/\/codeflarelimited.com\/blog\/?p=3200"},"modified":"2025-12-03T15:40:08","modified_gmt":"2025-12-03T14:40:08","slug":"bubble-sort-algorithm","status":"publish","type":"post","link":"https:\/\/codeflarelimited.com\/blog\/bubble-sort-algorithm\/","title":{"rendered":"Bubble Sort Algorithm"},"content":{"rendered":"\n<p>Bubble Sort is one of the simplest sorting algorithms in computer science. Although it\u2019s not the fastest or most efficient, it is often the&nbsp;<strong>first algorithm taught<\/strong>&nbsp;because it helps beginners understand fundamental ideas like&nbsp;<strong>comparison<\/strong>,&nbsp;<strong>swapping<\/strong>, and&nbsp;<strong>iteration<\/strong>.<\/p>\n\n\n\n<p>Let\u2019s break it down step-by-step.<\/p>\n\n\n\n<p><a href=\"https:\/\/codeflarelimited.com\">Learn how to write computer programs<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What Is Bubble Sort?<\/strong><\/h2>\n\n\n\n<p>Bubble Sort is a comparison-based sorting algorithm that&nbsp;<strong>repeatedly goes through a list<\/strong>, compares adjacent elements, and&nbsp;<strong>swaps them if they are in the wrong order<\/strong>.<br>This process continues until the entire list is sorted.<\/p>\n\n\n\n<p>It gets its name from the way&nbsp;<strong>larger elements \u201cbubble\u201d to the top<\/strong>&nbsp;(end of the list), and&nbsp;<strong>smaller elements sink to the bottom<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How Bubble Sort Works (Concept)<\/strong><\/h2>\n\n\n\n<p>Imagine you have a row of numbers:<\/p>\n\n\n\n<p><a href=\"https:\/\/app.codeflarelimited.com\">Learn programming online<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"python\" class=\"language-python\">[5, 1, 4, 2, 8]<\/code><\/pre>\n\n\n\n<p>Bubble Sort will:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Pass 1<\/strong><\/h3>\n\n\n\n<p>Compare each pair:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Compare 5 and 1 \u2192 swap \u2192\u00a0<code>[1, 5, 4, 2, 8]<\/code><\/li>\n\n\n\n<li>Compare 5 and 4 \u2192 swap \u2192\u00a0<code>[1, 4, 5, 2, 8]<\/code><\/li>\n\n\n\n<li>Compare 5 and 2 \u2192 swap \u2192\u00a0<code>[1, 4, 2, 5, 8]<\/code><\/li>\n\n\n\n<li>Compare 5 and 8 \u2192 no swap<\/li>\n<\/ul>\n\n\n\n<p>Largest element (8) moves to the end.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Pass 2<\/strong><\/h3>\n\n\n\n<p>Repeat the process for the remaining elements:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Compare 1 and 4 \u2192 ok<\/li>\n\n\n\n<li>Compare 4 and 2 \u2192 swap \u2192\u00a0<code>[1, 2, 4, 5, 8]<\/code><\/li>\n\n\n\n<li>Compare 4 and 5 \u2192 ok<\/li>\n<\/ul>\n\n\n\n<p>Next-largest element (5) is now correctly placed.<\/p>\n\n\n\n<p>Bubble Sort keeps doing this until&nbsp;<strong>no more swaps are needed<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Bubble Sort Algorithm (Step-by-Step)<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Loop from the start of the array to the end.<\/li>\n\n\n\n<li>Compare each pair of adjacent elements.<\/li>\n\n\n\n<li>Swap them if they are in the wrong order.<\/li>\n\n\n\n<li>After each full pass, the largest unsorted element is placed correctly.<\/li>\n\n\n\n<li>Stop when a full pass occurs with\u00a0<strong>zero swaps<\/strong>.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Bubble Sort in Pseudocode<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"python\" class=\"language-python\">repeat\n    swapped = false\n    for i = 0 to n-2\n        if array[i] &gt; array[i+1]\n            swap(array[i], array[i+1])\n            swapped = true\n    end for\nuntil swapped == false\n<\/code><\/pre>\n\n\n\n<p>The&nbsp;<code>swapped<\/code>&nbsp;flag is used to optimize the algorithm so it stops early when the list is already sorted.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Bubble Sort \u2014 JavaScript Implementation<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">function bubbleSort(arr) {\n  let swapped;\n\n  do {\n    swapped = false;\n    for (let i = 0; i &lt; arr.length - 1; i++) {\n      if (arr[i] &gt; arr[i + 1]) {\n        \/\/ Swap\n        [arr[i], arr[i + 1]] = [arr[i + 1], arr[i]];\n        swapped = true;\n      }\n    }\n  } while (swapped);\n\n  return arr;\n}\n\nconsole.log(bubbleSort([5, 1, 4, 2, 8]));\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Time and Space Complexity<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Case<\/th><th>Time Complexity<\/th><\/tr><\/thead><tbody><tr><td><strong>Best Case<\/strong>&nbsp;(already sorted)<\/td><td><strong>O(n)<\/strong><\/td><\/tr><tr><td><strong>Average Case<\/strong><\/td><td><strong>O(n\u00b2)<\/strong><\/td><\/tr><tr><td><strong>Worst Case<\/strong><\/td><td><strong>O(n\u00b2)<\/strong><\/td><\/tr><tr><td><strong>Space Complexity<\/strong><\/td><td><strong>O(1)<\/strong>&nbsp;(in-place)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Why O(n\u00b2)?<\/h3>\n\n\n\n<p>Because for each of the&nbsp;<strong>n<\/strong>&nbsp;elements, we might compare it with almost&nbsp;<strong>n<\/strong>&nbsp;others.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Where Bubble Sort Is Useful<\/strong><\/h2>\n\n\n\n<p>Even though it\u2019s not efficient for large data, Bubble Sort is useful when:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You want to teach sorting concepts to beginners<\/li>\n\n\n\n<li>Working with\u00a0<strong>very small lists<\/strong><\/li>\n\n\n\n<li>You need a\u00a0<strong>simple and easy-to-understand<\/strong>\u00a0algorithm<\/li>\n\n\n\n<li>You want to detect whether a list is\u00a0<strong>already sorted<\/strong>\u00a0(early stopping)<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Limitations of Bubble Sort<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Extremely slow on large lists<\/li>\n\n\n\n<li>Requires many comparisons<\/li>\n\n\n\n<li>Inefficient compared to modern algorithms like\u00a0<strong>QuickSort<\/strong>,\u00a0<strong>MergeSort<\/strong>, or\u00a0<strong>HeapSort<\/strong><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Advantages<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Very simple to implement<\/li>\n\n\n\n<li>Easy to visualize<\/li>\n\n\n\n<li>Works in-place (constant memory usage)<\/li>\n\n\n\n<li>Good for educational purposes<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Summary<\/strong><\/h2>\n\n\n\n<p>Bubble Sort is the simplest sorting algorithm that repeatedly compares and swaps adjacent elements until the list is ordered. Though not efficient for large datasets, it is a perfect introduction to sorting concepts, complexity analysis, and algorithm design.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bubble Sort is one of the simplest sorting algorithms in computer science. Although it\u2019s not the fastest or<\/p>\n","protected":false},"author":1,"featured_media":3201,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[98],"tags":[],"class_list":["post-3200","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-softare-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Bubble Sort Algorithm<\/title>\n<meta name=\"description\" content=\"Bubble Sort is one of the simplest sorting algorithms in computer science. Although it\u2019s not the fastest or most efficient,\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codeflarelimited.com\/blog\/bubble-sort-algorithm\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bubble Sort Algorithm\" \/>\n<meta property=\"og:description\" content=\"Bubble Sort is one of the simplest sorting algorithms in computer science. Although it\u2019s not the fastest or most efficient,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codeflarelimited.com\/blog\/bubble-sort-algorithm\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/facebook.com\/codeflretech\" \/>\n<meta property=\"article:published_time\" content=\"2025-12-03T14:40:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-03T14:40:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2025\/12\/2-2.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1080\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"codeflare\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codeflaretech\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/bubble-sort-algorithm\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/bubble-sort-algorithm\\\/\"},\"author\":{\"name\":\"codeflare\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#\\\/schema\\\/person\\\/7e65653d49add95629f8c1053c5cd76a\"},\"headline\":\"Bubble Sort Algorithm\",\"datePublished\":\"2025-12-03T14:40:06+00:00\",\"dateModified\":\"2025-12-03T14:40:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/bubble-sort-algorithm\\\/\"},\"wordCount\":459,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/bubble-sort-algorithm\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/2-2.webp\",\"articleSection\":[\"softare development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/bubble-sort-algorithm\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/bubble-sort-algorithm\\\/\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/bubble-sort-algorithm\\\/\",\"name\":\"Bubble Sort Algorithm\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/bubble-sort-algorithm\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/bubble-sort-algorithm\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/2-2.webp\",\"datePublished\":\"2025-12-03T14:40:06+00:00\",\"dateModified\":\"2025-12-03T14:40:08+00:00\",\"description\":\"Bubble Sort is one of the simplest sorting algorithms in computer science. Although it\u2019s not the fastest or most efficient,\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/bubble-sort-algorithm\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/bubble-sort-algorithm\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/bubble-sort-algorithm\\\/#primaryimage\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/2-2.webp\",\"contentUrl\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/2-2.webp\",\"width\":1080,\"height\":1080,\"caption\":\"bubble sort\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/bubble-sort-algorithm\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"softare development\",\"item\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/softare-development\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Bubble Sort Algorithm\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/\",\"name\":\"\",\"description\":\"Sustainable solutions\",\"publisher\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#organization\",\"name\":\"Codeflare Limited\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/codeflare.png\",\"contentUrl\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/codeflare.png\",\"width\":1040,\"height\":263,\"caption\":\"Codeflare Limited\"},\"image\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#\\\/schema\\\/person\\\/7e65653d49add95629f8c1053c5cd76a\",\"name\":\"codeflare\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/59cef917c86d965eea581d2747f51bd6382003a68bfce7c8a4dfec98b4cd838d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/59cef917c86d965eea581d2747f51bd6382003a68bfce7c8a4dfec98b4cd838d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/59cef917c86d965eea581d2747f51bd6382003a68bfce7c8a4dfec98b4cd838d?s=96&d=mm&r=g\",\"caption\":\"codeflare\"},\"description\":\"Latest tech news and coding tips.\",\"sameAs\":[\"https:\\\/\\\/codeflarelimited.com\\\/blog\",\"https:\\\/\\\/facebook.com\\\/codeflretech\",\"https:\\\/\\\/instagram.com\\\/codeflaretech\",\"https:\\\/\\\/x.com\\\/codeflaretech\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCuBLtiYqsajHdqw0uyt7Ofw?sub_confirmation=1\"],\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/author\\\/watcher\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Bubble Sort Algorithm","description":"Bubble Sort is one of the simplest sorting algorithms in computer science. Although it\u2019s not the fastest or most efficient,","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:\/\/codeflarelimited.com\/blog\/bubble-sort-algorithm\/","og_locale":"en_US","og_type":"article","og_title":"Bubble Sort Algorithm","og_description":"Bubble Sort is one of the simplest sorting algorithms in computer science. Although it\u2019s not the fastest or most efficient,","og_url":"https:\/\/codeflarelimited.com\/blog\/bubble-sort-algorithm\/","article_author":"https:\/\/facebook.com\/codeflretech","article_published_time":"2025-12-03T14:40:06+00:00","article_modified_time":"2025-12-03T14:40:08+00:00","og_image":[{"width":1080,"height":1080,"url":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2025\/12\/2-2.webp","type":"image\/webp"}],"author":"codeflare","twitter_card":"summary_large_image","twitter_creator":"@codeflaretech","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/codeflarelimited.com\/blog\/bubble-sort-algorithm\/#article","isPartOf":{"@id":"https:\/\/codeflarelimited.com\/blog\/bubble-sort-algorithm\/"},"author":{"name":"codeflare","@id":"https:\/\/codeflarelimited.com\/blog\/#\/schema\/person\/7e65653d49add95629f8c1053c5cd76a"},"headline":"Bubble Sort Algorithm","datePublished":"2025-12-03T14:40:06+00:00","dateModified":"2025-12-03T14:40:08+00:00","mainEntityOfPage":{"@id":"https:\/\/codeflarelimited.com\/blog\/bubble-sort-algorithm\/"},"wordCount":459,"commentCount":0,"publisher":{"@id":"https:\/\/codeflarelimited.com\/blog\/#organization"},"image":{"@id":"https:\/\/codeflarelimited.com\/blog\/bubble-sort-algorithm\/#primaryimage"},"thumbnailUrl":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2025\/12\/2-2.webp","articleSection":["softare development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codeflarelimited.com\/blog\/bubble-sort-algorithm\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codeflarelimited.com\/blog\/bubble-sort-algorithm\/","url":"https:\/\/codeflarelimited.com\/blog\/bubble-sort-algorithm\/","name":"Bubble Sort Algorithm","isPartOf":{"@id":"https:\/\/codeflarelimited.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codeflarelimited.com\/blog\/bubble-sort-algorithm\/#primaryimage"},"image":{"@id":"https:\/\/codeflarelimited.com\/blog\/bubble-sort-algorithm\/#primaryimage"},"thumbnailUrl":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2025\/12\/2-2.webp","datePublished":"2025-12-03T14:40:06+00:00","dateModified":"2025-12-03T14:40:08+00:00","description":"Bubble Sort is one of the simplest sorting algorithms in computer science. Although it\u2019s not the fastest or most efficient,","breadcrumb":{"@id":"https:\/\/codeflarelimited.com\/blog\/bubble-sort-algorithm\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codeflarelimited.com\/blog\/bubble-sort-algorithm\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codeflarelimited.com\/blog\/bubble-sort-algorithm\/#primaryimage","url":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2025\/12\/2-2.webp","contentUrl":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2025\/12\/2-2.webp","width":1080,"height":1080,"caption":"bubble sort"},{"@type":"BreadcrumbList","@id":"https:\/\/codeflarelimited.com\/blog\/bubble-sort-algorithm\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codeflarelimited.com\/blog\/"},{"@type":"ListItem","position":2,"name":"softare development","item":"https:\/\/codeflarelimited.com\/blog\/softare-development\/"},{"@type":"ListItem","position":3,"name":"Bubble Sort Algorithm"}]},{"@type":"WebSite","@id":"https:\/\/codeflarelimited.com\/blog\/#website","url":"https:\/\/codeflarelimited.com\/blog\/","name":"","description":"Sustainable solutions","publisher":{"@id":"https:\/\/codeflarelimited.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codeflarelimited.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/codeflarelimited.com\/blog\/#organization","name":"Codeflare Limited","url":"https:\/\/codeflarelimited.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codeflarelimited.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2020\/11\/codeflare.png","contentUrl":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2020\/11\/codeflare.png","width":1040,"height":263,"caption":"Codeflare Limited"},"image":{"@id":"https:\/\/codeflarelimited.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/codeflarelimited.com\/blog\/#\/schema\/person\/7e65653d49add95629f8c1053c5cd76a","name":"codeflare","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/59cef917c86d965eea581d2747f51bd6382003a68bfce7c8a4dfec98b4cd838d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/59cef917c86d965eea581d2747f51bd6382003a68bfce7c8a4dfec98b4cd838d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/59cef917c86d965eea581d2747f51bd6382003a68bfce7c8a4dfec98b4cd838d?s=96&d=mm&r=g","caption":"codeflare"},"description":"Latest tech news and coding tips.","sameAs":["https:\/\/codeflarelimited.com\/blog","https:\/\/facebook.com\/codeflretech","https:\/\/instagram.com\/codeflaretech","https:\/\/x.com\/codeflaretech","https:\/\/www.youtube.com\/channel\/UCuBLtiYqsajHdqw0uyt7Ofw?sub_confirmation=1"],"url":"https:\/\/codeflarelimited.com\/blog\/author\/watcher\/"}]}},"jetpack_featured_media_url":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2025\/12\/2-2.webp","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/posts\/3200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/comments?post=3200"}],"version-history":[{"count":1,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/posts\/3200\/revisions"}],"predecessor-version":[{"id":3202,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/posts\/3200\/revisions\/3202"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/media\/3201"}],"wp:attachment":[{"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/media?parent=3200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/categories?post=3200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/tags?post=3200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}