{"id":27153460,"url":"https://github.com/tankengine-ish/sorting_algorithm_visualizer","last_synced_at":"2025-04-08T16:17:04.312Z","repository":{"id":212553840,"uuid":"731346504","full_name":"TankEngine-ish/Sorting_Algorithm_Visualizer","owner":"TankEngine-ish","description":"Algorithm Visualizer [personal project]","archived":false,"fork":false,"pushed_at":"2024-01-11T19:38:29.000Z","size":6400,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-01-12T06:29:45.603Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TankEngine-ish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-13T21:59:22.000Z","updated_at":"2023-12-15T17:13:26.000Z","dependencies_parsed_at":"2024-01-12T00:13:32.260Z","dependency_job_id":"83bc954b-6228-442e-bef0-f04471489a2a","html_url":"https://github.com/TankEngine-ish/Sorting_Algorithm_Visualizer","commit_stats":null,"previous_names":["tankengine-ish/sorting_algorithm_visualizer"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TankEngine-ish%2FSorting_Algorithm_Visualizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TankEngine-ish%2FSorting_Algorithm_Visualizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TankEngine-ish%2FSorting_Algorithm_Visualizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TankEngine-ish%2FSorting_Algorithm_Visualizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TankEngine-ish","download_url":"https://codeload.github.com/TankEngine-ish/Sorting_Algorithm_Visualizer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247878013,"owners_count":21011158,"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":[],"created_at":"2025-04-08T16:17:03.860Z","updated_at":"2025-04-08T16:17:04.303Z","avatar_url":"https://github.com/TankEngine-ish.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sorting Algorithm Visualizer\n\nFor my very first project in Python I decided to go for an\nalgorithm visualizer. \n\nIt was all done in an an Anaconda environment along with Jupyter and IPyWidgets for the plotting charts inside VSCode.\nIn the first part of the project I created some simple .png files with the unsorted and then sorted arrays.\nThen, in the second part of the project I animated the sorting process but also added the number of times the arrays were accessed.\n\nThe number of elements in the arrays can be easily changed inside the python code by swapping the value of 'N'\nwith any anumber. I chose 30 elements. In the future I might add more popular algorithms to this project.\nYou can check the results below.\n\n\n\n## Insertion Sort\n\nThe first algorithm that was implemented was insertion sort.\nIt is one of the simplest and most commonly used sorting algorithms. \nIt involves the sorted list created based on an iterative comparison of each element in the list with its adjacent element.\n\nAn index pointing at the current element indicates the position of the sort. At the beginning of the sort (index=0), the current value is compared to the adjacent value to the left. If the value is greater than the current value, no modifications are made to the list; this is also the case if the adjacent value and the current value are the same numbers. \n\nHowever, if the adjacent value to the left of the current value is lesser, then the adjacent value position is moved to the left, and only stops moving to the left if the value to the left of it is lesser. Despite its simplicity, Insertion sort is quite inefficient compared to quicksort, merge sort etc.\n\n\n![Alt text](\u003cImages/Screenshot from 2023-12-16 00-03-51.png\u003e)\n\nThis is the second part of the project where I actualy animated the sorting process.\nYou can see how slow insertion sort is.\n\n![insertion](./Images/insertion.gif) \n\n## Quick Sort\n\nThe second algorithm I implemented was quick sort.\nIt's a recursive, divide-and-conquer algorithm that is ranked as fastest in its class. \nIt has an average time complexity of O (n log n ), which compared to its peers is pretty fast. \nQuick sort creates two empty arrays to hold elements less than the pivot value and elements greater than the pivot value, and then recursively sort the sub arrays. There are two basic operations in the algorithm, swapping items in place and partitioning a section of the array.\n\nYou can also see the time it took to sort (0.1 ms) with the help\nof the python's time library.\n\n\n![Alt text](\u003cImages/Screenshot from 2023-12-23 22-12-33.png\u003e)\n\n\nThis is the second part of the project where I actualy animated the sorting process.\nYou can see how much faster quicksort is than insertion.\n\n![quicksort](./Images/quicksort.gif) ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftankengine-ish%2Fsorting_algorithm_visualizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftankengine-ish%2Fsorting_algorithm_visualizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftankengine-ish%2Fsorting_algorithm_visualizer/lists"}