{"id":17025988,"url":"https://github.com/ForeignGods/Sorting-Algorithms-Blender","last_synced_at":"2026-04-13T00:30:21.451Z","repository":{"id":37767831,"uuid":"488342031","full_name":"ForeignGods/Sorting-Algorithms-Blender","owner":"ForeignGods","description":"Sorting algorithms visualized using the Blender Python API.","archived":false,"fork":false,"pushed_at":"2022-06-30T16:24:16.000Z","size":42377,"stargazers_count":655,"open_issues_count":0,"forks_count":26,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-10-14T07:31:58.021Z","etag":null,"topics":["blender","python","sorting-visualization"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ForeignGods.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-03T19:44:01.000Z","updated_at":"2024-09-22T17:37:18.000Z","dependencies_parsed_at":"2022-07-16T19:16:10.033Z","dependency_job_id":null,"html_url":"https://github.com/ForeignGods/Sorting-Algorithms-Blender","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ForeignGods%2FSorting-Algorithms-Blender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ForeignGods%2FSorting-Algorithms-Blender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ForeignGods%2FSorting-Algorithms-Blender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ForeignGods%2FSorting-Algorithms-Blender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ForeignGods","download_url":"https://codeload.github.com/ForeignGods/Sorting-Algorithms-Blender/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239997237,"owners_count":19731370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blender","python","sorting-visualization"],"created_at":"2024-10-14T07:30:18.371Z","updated_at":"2026-04-13T00:30:21.372Z","avatar_url":"https://github.com/ForeignGods.png","language":"Python","readme":"Sorting-Algorithms-Blender\n==========================\n\nSorting algorithms visualized using the Blender Python API.\n\nTable of contents\n=================\n\n\u003c!--ts--\u003e\n   * [Introduction](#introduction)\n      * [Description](#description)\n      * [Getting Started](#getting-started)\n      * [Limitations](#limitations)\n      * [Possible Updates](#possible-updates)\n   * [Sorting Algorithms](#sorting-algorithms)\n      * [Bubble Sort](#bubble-sort)\n      * [Insertion Sort](#insertion-sort)\n      * [Selection Sort](#selection-sort)\n      * [Heap Sort](#heap-sort)\n      * [Shell Sort](#shell-sort)\n      * [Merge Sort](#merge-sort)\n      * [Quick Sort](#quick-sort)\n   * [Big O](#big-o)\n      * [What is Big O Notation?](#what-is-big-o-notation)\n      * [Time Complexity Notations](#time-complexity-notations)\n      * [Table of Sorting Algorithms](#table-of-sorting-algorithms)\n      * [Big O Complexity Chart](#big-o-complexity-chart)\n\u003c!--te--\u003e\n\nIntroduction\n============\n## Description\nRunning one of the scripts in this project generates primitive meshes in Blender, wich are animated to visualize various sorting algorithms.\u003cbr\u003e\nKeyframes are incrementaly inserted according to the current position of the element in the array during the sorting.\u003cbr\u003e\nThe four folders \u003cstrong\u003e(sort_circle, sort_color, sort_combined, sort_scale)\u003c/strong\u003e contain four different types of visualization.\n\n|Type|Sorting Criteria|Representation of Index|Extras|\n|:--:|:--------------:|:---------------------:|:----:|\n|\u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_circle\" target=\"_blank\"\u003esort_circle|hsv of material|rotation of cuboid|hsv = 360°|\n|\u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_color\" target=\"_blank\"\u003esort_color|red + green of material|location of plane|custom color gradient|\n|\u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_combined\" target=\"_blank\"\u003esort_combined|red + green of material|location of plane|multiple 2d arrays arranged into a cube|\n|\u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_scale\" target=\"_blank\"\u003esort_scale\u003c/a\u003e|scale of cubiod|location of cuboid|array access and  comparison counter|\n\n## Getting Started\n\n\u003col\u003e\n\u003cli\u003eDownload, install and start \u003ca href=\"https://www.blender.org/\"\u003eBlender\u003ca\u003e.\u003c/li\u003e\n\u003cli\u003eOpen the .py file in the \u003ca href=\"https://docs.blender.org/manual/en/latest/editors/text_editor.html\"\u003e Text Editor\u003c/a\u003e.\u003c/li\u003e\n\u003cli\u003eClick the play button to run the script.\u003c/li\u003e\n\u003c/ol\u003e\n\n## Limitations\nThese visualizations don't show the efficiency of the algorithms.\u003cbr\u003e\nThey only visualize movement of the elements within the array.\u003cbr\u003e\nBut the array access and comparison counters are indicators of the time complexity of the algorithms.\u003cbr\u003e\nFor more information about the time complexity, you can take a look at the [Big O Table](#table-of-sorting-algorithms).\u003cbr\u003e\n\n## Possible Updates\n\nBelow I compiled a list of features that could be implemented in the future. \n  \n\u003cul\u003e \n\u003cli\u003eincrease efficiency of the setup_array() function, to allow greater object count\u003c/li\u003e\n \u003cli\u003eadding audio \u003ca href= \"https://www.youtube.com/watch?v=kPRA0W1kECg\u0026t=57s\"\u003e\"Audibilization\"\u003c/a\u003e \u003c/li\u003e\n\u003cli\u003eadding more sorting algorithms\u003c/li\u003e\n\u003cli\u003eadding more types of visualization e.g.\n\u003ca href=\"https://www.youtube.com/watch?v=_bxWi1sxRWA\u0026t=194s\"\u003eSphere Agitation\u003ca\u003e, \n\u003ca href=\"https://www.youtube.com/watch?v=ohn_NwAQZtE\"\u003eCube Amalgam\u003ca\u003e, \n\u003ca href=\"https://www.youtube.com/watch?v=S0RtR2Yllzk\"\u003eDynamic Hoops\u003ca\u003e\u003c/li\u003e\n\u003cli\u003eauto generate camera with correct transforms based on the count of sorted objects\u003c/li\u003e\n\u003cli\u003ecreate panel were you can choose different options like colors, sorting algorithms and count of objects\u003c/li\u003e\n\u003cli\u003eimprove merge sort visualization so there are no gaps and overlapping objects\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cstrong\u003eContributions to this project with either ideas from the list or your own are welcome.\u003c/strong\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \nSorting Algorithms\n==================\n  \n|\u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_combined/combined_sort_cube.py\" target=\"_blank\"\u003ecombined_sort_cube.py\u003c/a\u003e|\n| ------------- |\n|![cube_sort_opti](https://user-images.githubusercontent.com/78089013/176444887-4d68b8df-cc91-4415-b3d4-8540303f284e.gif)|\n  \n\n\u003c/div\u003e\n\n## Bubble Sort\n\u003cp\u003e\nBubble sort is one of the most straightforward sorting algorithms, it makes multiple passes through a list.\u003cbr\u003e\n\u003cul\u003e\n\u003cli\u003eStarting with the first element, compare the current element with the next element of the array.\u003c/li\u003e\n\u003cli\u003eIf the current element is greater than the next element of the array, swap them.\u003c/li\u003e\n\u003cli\u003eIf the current element is less than the next element, move to the next element.\u003c/li\u003e\n\u003c/ul\u003e\nIn essence, each item “bubbles” up to the location where it belongs.\n\u003c/p\u003e\n\n| \u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_scale/bubble_sort_scale.py\" target=\"_blank\"\u003ebubble_sort_scale.py\u003c/a\u003e|\u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_color/bubble_sort_color.py\" target=\"_blank\"\u003ebubble_sort_color.py\u003c/a\u003e|\u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_circle/bubble_sort_color.py\" target=\"_blank\"\u003ebubble_sort_circle.py\u003c/a\u003e|\n| ------------- |-------------|------------|\n|![bubble_scale_opti](https://user-images.githubusercontent.com/78089013/176308250-e75134b8-177a-40bc-b984-5cfa13c09baa.gif)|![bubble_color_opti](https://user-images.githubusercontent.com/78089013/176433216-9b3b09c6-12ce-4713-bee9-ecbab979efbd.gif)|![bubble_circle_perf](https://user-images.githubusercontent.com/78089013/176554030-355ece1a-9560-4928-bbf2-40445f1fe33e.gif)|\n\n## Insertion Sort\n\n\u003cp\u003eLike bubble sort, the insertion sort algorithm is straightforward to implement and understand.\u003cbr\u003e\n\u003cul\u003e\n\u003cli\u003eIterate from arr[1] to arr[n] over the array.\u003c/li\u003e\n\u003cli\u003eCompare the current element (key) to its predecessor.\u003c/li\u003e\n\u003cli\u003eIf the key element is smaller than its predecessor, compare its elements before.\u003c/li\u003e\n\u003cli\u003eMove the greater elements one position up to make space for the swapped element.\u003c/li\u003e\n\u003c/ul\u003e\nIt splits the given array into sorted and unsorted parts, \nthen the values from the unsorted parts are picked and placed at the correct position in the sorted part.\u003c/p\u003e\n\n| \u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_scale/insertion_sort_scale.py\" target=\"_blank\"\u003einsertion_sort_scale.py\u003c/a\u003e|\u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_color/insertion_sort_color.py\" target=\"_blank\"\u003einsertion_sort_color.py\u003c/a\u003e|\n| ------------- |:-------------:| \n|![insertion_scale_opti](https://user-images.githubusercontent.com/78089013/176308303-c76e5296-d91e-4c83-badc-bdb9546c230b.gif)|![insertion_color_opti](https://user-images.githubusercontent.com/78089013/176433668-28088cc9-5d98-4ba5-971f-0cb9b02348a5.gif)| \n\n## Selection Sort\n\nThe algorithm maintains two subarrays in a given array.\n\u003cul\u003e\n\u003cli\u003eThe subarray which is already sorted.\u003c/li\u003e\n\u003cli\u003eRemaining subarray which is unsorted.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eIn every iteration of selection sort, the minimum element (considering ascending order) from the unsorted subarray is picked and moved to the sorted subarray.\u003c/p\u003e\n\n|\u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_scale/selection_sort_scale.py\" target=\"_blank\"\u003eselection_sort_scale.py\u003c/a\u003e|\u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_color/selection_sort_color.py\" target=\"_blank\"\u003eselection_sort_color.py\u003c/a\u003e|\u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_circle/selection_sort_circle.py\" target=\"_blank\"\u003eselection_sort_circle.py\u003c/a\u003e|\n| ------------- |:-------------:|-------|\n|![selection_sort_opti](https://user-images.githubusercontent.com/78089013/176308368-bdf31895-fae2-49ef-b9ad-8845a7fcba7a.gif)|![selection_color_opti](https://user-images.githubusercontent.com/78089013/176435219-96aa4818-4ae5-411e-916c-69a3285e6f14.gif)|![selection_circle_perf](https://user-images.githubusercontent.com/78089013/176554628-3c754a53-aca4-46ff-a015-0b8a6dac2999.gif)|\n\n\n\n\n## Heap Sort\n\nBased on the binary heap data structure, heap sort is mainly considered as a comparison-based sorting algorithm.\u003cbr\u003e\nIn this sorting technique, at first, the minimum element is found out and then the minimum element gets placed at its right position at the beginning of the array.\u003cbr\u003e\nFor the rest of the elements, the same process gets repeated.\u003cbr\u003e\nSo, we can say that heap sort is quite similar to the selection sort technique.\u003cbr\u003e\nHeap sort basically recursively performs two main operations:\n\u003cul\u003e\n\u003cli\u003eBuild a heap H, using the elements of array.\u003c/li\u003e\n\u003cli\u003eRepeatedly delete the root element of the heap formed in 1st phase.\u003c/li\u003e\n\u003c/ul\u003e\n  \n|\u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_scale/heap_sort_scale.py\" target=\"_blank\"\u003eheap_sort_scale.py\u003c/a\u003e|\u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_color/heap_sort_color.py\" target=\"_blank\"\u003eheap_sort_color.py\u003c/a\u003e| \n| ------------- |:-------------:| \n|![heap_scale_opti](https://user-images.githubusercontent.com/78089013/176308418-ca1bdf07-9266-429f-a240-2b5484de6f51.gif)|![heap_color_opti](https://user-images.githubusercontent.com/78089013/176433372-e74c2fce-f4b1-4b6e-98b1-ea3fe5c80b48.gif)|   \n \n## Shell Sort\n\u003cp\u003e\nThe shell sort algorithm extends the insertion sort algorithm and is very efficient in sorting widely unsorted arrays.\u003cbr\u003e\nThe array is divided into sub-arrays and then insertion sort is applied.\u003cbr\u003e\nThe algorithm is:\n\u003cul\u003e\n\u003cli\u003eCalculate the value of the gap.\u003c/li\u003e\n\u003cli\u003eDivide the array into these sub-arrays.\u003c/li\u003e\n\u003cli\u003eApply the insertion sort.\u003c/li\u003e\n\u003cli\u003eRepeat this process until the complete list is sorted.\u003c/li\u003e\n\u003c/ul\u003e\nThis sorting technique works by sorting elements in pairs, far away from each other and subsequently reduces their gap.\u003cbr\u003e The gap is known as the interval. We can calculate this gap/interval with the help of Knuth’s formula.\n\u003c/p\u003e\n\n|\u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_scale/shell_sort_scale.py\" target=\"_blank\"\u003eshell_sort_scale.py\u003c/a\u003e|\u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_color/shell_sort_color.py\" target=\"_blank\"\u003eshell_sort_color.py\u003c/a\u003e| \n| ------------- |:-------------:| \n|![shell_scale_opti](https://user-images.githubusercontent.com/78089013/176308477-b31cd21f-e7b7-43ca-b663-ecd991f1f5dd.gif)|![shell_color_opti](https://user-images.githubusercontent.com/78089013/176433418-ab39374e-0783-453d-8a9c-d4a4441e2440.gif)| \n\n## Merge Sort\n\nMerge sort uses the divide and conquer approach to sort the elements.\u003cbr\u003e\nIt is one of the most popular and efficient sorting algorithms.\u003cbr\u003e\n\nThe sub-lists are divided again and again into halves until the list cannot be divided further.\u003cbr\u003e\nThen we combine the pair of one element lists into two-element lists, sorting them in the process.\u003cbr\u003e\nThe sorted two-element pairs is merged into the four-element lists, and so on until we get the sorted list.\n\n| \u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_scale/merge_sort_scale.py\" target=\"_blank\"\u003emerge_sort_scale.py\u003c/a\u003e|\u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_color/merge_sort_color.py\" target=\"_blank\"\u003emerge_sort_color.py\u003c/a\u003e|\u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_circle/merge_sort_circle.py\" target=\"_blank\"\u003emerge_sort_circle.py\u003c/a\u003e|\n| ------------- |:-------------:|------------|\n|![merge_scale_opti](https://user-images.githubusercontent.com/78089013/176308527-78abf018-f756-475d-bae9-32b93b47fb17.gif)|![merge_color_opti](https://user-images.githubusercontent.com/78089013/176433465-66af0062-7425-4a60-8a4d-b49095d6c0cb.gif)|![merge_circle_perf](https://user-images.githubusercontent.com/78089013/176554327-0ed04372-5aa5-4236-b8bb-47d5d31d54a1.gif)|\n\n## Quick Sort\n\nLike Merge Sort, Quick Sort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot. There are many different versions of Quick Sort that pick pivot in different ways. \n\u003cul\u003e\n\n\u003cli\u003eAlways pick first element as pivot.\u003c/li\u003e\n\u003cli\u003eAlways pick last element as pivot.\u003c/li\u003e\n\u003cli\u003ePick a random element as pivot.\u003c/li\u003e\n\u003cli\u003ePick median as pivot. (implemented below)\u003c/li\u003e\n\u003c/ul\u003e\n\nThe key process in quickSort is \u003cstrong\u003epartition()\u003c/strong\u003e. Target of partitions is, given an array and an element x of array as pivot, put x at its correct position in sorted array and put all smaller elements (smaller than x) before x, and put all greater elements (greater than x) after x.\u003cbr\u003e\nAll this should be done in linear time.\n\n| \u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_scale/quick_sort_scale.py\" target=\"_blank\"\u003equick_sort_scale.py\u003c/a\u003e|\u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_color/quick_sort_color.py\" target=\"_blank\"\u003equick_sort_color.py\u003c/a\u003e|\u003ca href=\"https://github.com/ForeignGods/Sorting-Algorithms-Blender/blob/main/sort_circle/quick_sort_circle.py\" target=\"_blank\"\u003equick_sort_circle.py\u003c/a\u003e|\n| ------------- |:-------------:|--------|\n|![quick_scale_opti](https://user-images.githubusercontent.com/78089013/176308577-3c13996b-7443-4b67-838c-7de3dc36311f.gif)|![quick_color_opti](https://user-images.githubusercontent.com/78089013/176433517-cc0cc985-c60d-42e9-a5b0-ecbe8c2621bf.gif)|![quick_circle_perf](https://user-images.githubusercontent.com/78089013/176554458-2d7b97ad-8c00-4ab6-b988-4d74fa466994.gif)|\n\nBig O\n=====\n\n### What is Big O Notation?\n\nBig O notation is the language we use for talking about how long an algorithm takes to run.\u003cbr\u003e\nIt's how we compare the efficiency of different approaches to a problem.\u003cbr\u003e\nWith Big O notation we express the runtime in terms of **how quickly it grows relative to the input, as the input gets arbitrarily large.**\n\nLet's break that down:\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003ehow quickly the runtime grows\u003c/strong\u003e\n\nIt's hard to pin down the exact runtime of an algorithm.\u003cbr\u003e \nIt depends on the speed of the processor, what else the computer is running, etc. So instead of talking about the runtime directly, we use big O notation to talk about how quickly the runtime grows.\u003c/li\u003e\n    \n\u003cli\u003e\u003cstrong\u003erelative to the input\u003c/strong\u003e\n\nIf we were measuring our runtime directly, we could express our speed in seconds.\u003cbr\u003e\nSince we're measuring how quickly our runtime grows, we need to express our speed in terms of...something else.\u003cbr\u003e\nWith Big O notation, we use the size of the input, which we call\u003cstrong\u003e \"n\"\u003c/strong\u003e.\u003cbr\u003e\nSo we can say things like the runtime grows \"on the order of the size of the input\" \u003cstrong\u003e(O(n))\u003c/strong\u003e or \"on the order of the square of the size of the input\" \u003cstrong\u003e(O(n^2))\u003c/strong\u003e.\u003c/li\u003e\n    \n\u003cli\u003e\u003cstrong\u003eas the input gets arbitrarily\u003c/strong\u003e\n\nOur algorithm may have steps that seem expensive when \u003cstrong\u003e\"n\"\u003c/strong\u003e is small but are eclipsed eventually by other steps as \u003cstrong\u003e\"n\"\u003c/strong\u003e gets huge.\u003cbr\u003e \nFor big O analysis, we care most about the stuff that grows fastest as the input grows, because everything else is quickly eclipsed as \u003cstrong\u003e\"n\"\u003c/strong\u003e gets very large.\u003c/li\u003e\n\u003c/ul\u003e\n\n### Time Complexity Notations\n \nThese are the asymptotic notations that are used for calculating the time complexity of the sorting algorithms:\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003eBig O Notation, O:\u003c/strong\u003e\u003c/li\u003e\n  \nIt measures the upper limit of an algorithm's running time or the worst-case time complexity. It is known by O(n) for input size 'n'.\n\n\u003cli\u003e\u003cstrong\u003eOmega Notation, Ω:\u003c/strong\u003e\u003c/li\u003e\n\nIt measures the minimum time taken by algorithms to execute, and calculates the best case time complexity in sorting. It is known by Ω(n) for input size 'n'.\n\n\u003cli\u003e\u003cstrong\u003eTheta Notation, θ:\u003c/strong\u003e\u003c/li\u003e\n\nIt measures the average time taken by an algorithm to execute. Or, the lower bound and upper bound of an algorithm's running time. It is known by θ(n) for input size 'n'.\n\u003c/ul\u003e\n  \n### Table of Sorting Algorithms\n\nIn applications such as in radix sort, a bound on the maximum key value \u003cstrong\u003e\"k\"\u003c/strong\u003e will be known in advance, and can be assumed to be part of the input to the algorithm.\u003cbr\u003e\nHowever, if the value of \u003cstrong\u003e\"k\"\u003c/strong\u003e is not already known then it may be computed, as a first step, by an additional loop over the data to determine the maximum key value.\u003cbr\u003e  \n  \n\u003ctable\u003e\n    \u003ctr\u003e\n      \u003cth\u003eAlgorithm\u003c/th\u003e\n      \u003cth colspan=\"3\"\u003eTime Complexity\u003c/th\u003e\n      \u003cth\u003eSpace Complexity\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003eBest Case\u003c/th\u003e\n      \u003cth\u003eAverage Case\u003c/th\u003e\n      \u003cth\u003eWorst Case\u003c/th\u003e\n      \u003cth\u003eWorst Case\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ca href=\"http://en.wikipedia.org/wiki/Quicksort\"\u003eQuick Sort\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"orange\"\u003eΩ(n log(n))\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/bad.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"orange\"\u003eΘ(n log(n))\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/bad.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"red\"\u003eO(n^2)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/horrible.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"yellow-green\"\u003eO(log(n))\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/good.png\" align=\"left\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ca href=\"http://en.wikipedia.org/wiki/Merge_sort\"\u003eMerge Sort\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"orange\"\u003eΩ(n log(n))\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/bad.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"orange\"\u003eΘ(n log(n))\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/bad.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"orange\"\u003eO(n log(n))\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/bad.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"yellow\"\u003eO(n)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/fair.png\" align=\"left\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ca href=\"http://en.wikipedia.org/wiki/Timsort\"\u003eTim Sort\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"yellow\"\u003eΩ(n)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/fair.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"orange\"\u003eΘ(n log(n))\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/bad.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"orange\"\u003eO(n log(n))\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/bad.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"yellow\"\u003eO(n)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/fair.png\" align=\"left\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ca href=\"http://en.wikipedia.org/wiki/Heapsort\"\u003eHeap Sort\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"orange\"\u003eΩ(n log(n))\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/bad.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"orange\"\u003eΘ(n log(n))\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/bad.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"orange\"\u003eO(n log(n))\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/bad.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"green\"\u003eO(1)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/excellent.png\" align=\"left\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ca href=\"http://en.wikipedia.org/wiki/Bubble_sort\"\u003eBubble Sort\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"yellow\"\u003eΩ(n)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/fair.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"red\"\u003eΘ(n^2)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/horrible.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"red\"\u003eO(n^2)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/horrible.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"green\"\u003eO(1)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/excellent.png\" align=\"left\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ca href=\"http://en.wikipedia.org/wiki/Insertion_sort\"\u003eInsertion Sort\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"yellow\"\u003eΩ(n)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/fair.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"red\"\u003eΘ(n^2)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/horrible.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"red\"\u003eO(n^2)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/horrible.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"green\"\u003eO(1)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/excellent.png\" align=\"left\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ca href=\"http://en.wikipedia.org/wiki/Selection_sort\"\u003eSelection Sort\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"red\"\u003eΩ(n^2)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/horrible.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"red\"\u003eΘ(n^2)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/horrible.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"red\"\u003eO(n^2)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/horrible.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"green\"\u003eO(1)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/excellent.png\" align=\"left\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ca href=\"https://en.wikipedia.org/wiki/Tree_sort\"\u003eTree Sort\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"orange\"\u003eΩ(n log(n))\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/bad.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"orange\"\u003eΘ(n log(n))\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/bad.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"red\"\u003eO(n^2)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/horrible.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"yellow\"\u003eO(n)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/fair.png\" align=\"left\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ca href=\"http://en.wikipedia.org/wiki/Shellsort\"\u003eShell Sort\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"orange\"\u003eΩ(n log(n))\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/bad.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"red\"\u003eΘ(n(log(n))^2)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/horrible.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"red\"\u003eO(n(log(n))^2)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/horrible.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"green\"\u003eO(1)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/excellent.png\" align=\"left\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ca rel=\"tooltip\" title=\"Only for integers. k is a number of buckets\" href=\"http://en.wikipedia.org/wiki/Bucket_sort\"\u003eBucket Sort\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"green\"\u003eΩ(n+k)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/excellent.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"green\"\u003eΘ(n+k)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/excellent.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"red\"\u003eO(n^2)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/horrible.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"yellow\"\u003eO(n)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/fair.png\" align=\"left\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ca rel=\"tooltip\" title=\"Constant number of digits 'k'\" href=\"http://en.wikipedia.org/wiki/Radix_sort\"\u003eRadix Sort\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"green\"\u003eΩ(nk)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/excellent.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"green\"\u003eΘ(nk)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/excellent.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"green\"\u003eO(nk)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/excellent.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"yellow\"\u003eO(n+k)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/fair.png\" align=\"left\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ca rel=\"tooltip\" title=\"Difference between maximum and minimum number 'k'\" href=\"https://en.wikipedia.org/wiki/Counting_sort\"\u003eCounting Sort\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"green\"\u003eΩ(n+k)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/excellent.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"green\"\u003eΘ(n+k)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/excellent.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"green\"\u003eO(n+k)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/excellent.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"yellow\"\u003eO(k)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/fair.png\" align=\"left\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ca href=\"https://en.wikipedia.org/wiki/Cubesort\"\u003eCube Sort\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"yellow\"\u003eΩ(n)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/fair.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"orange\"\u003eΘ(n log(n))\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/bad.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"orange\"\u003eO(n log(n))\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/bad.png\" align=\"left\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode class=\"yellow\"\u003eO(n)\u003c/code\u003e\u003cbr\u003e\u003cimg src=\"./img/fair.png\" align=\"left\"\u003e\u003c/td\u003e\n   \u003c/tr\u003e\n\n\u003c/table\u003e\n\n### Big O Complexity Chart\n\n![graph](https://user-images.githubusercontent.com/78089013/176728121-e43b51b8-8bdd-4d0a-8376-62662e26b813.svg)\n\n\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FForeignGods%2FSorting-Algorithms-Blender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FForeignGods%2FSorting-Algorithms-Blender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FForeignGods%2FSorting-Algorithms-Blender/lists"}