{"id":19771693,"url":"https://github.com/alexandrelamarre/sortvisualizer","last_synced_at":"2026-05-06T17:35:29.751Z","repository":{"id":123959717,"uuid":"328819853","full_name":"alexandreLamarre/SortVisualizer","owner":"alexandreLamarre","description":"A web app that visualizes 12+ sorting algorithms in a variety of interchangeable ways.","archived":false,"fork":false,"pushed_at":"2024-05-01T11:53:52.000Z","size":7952,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-01T16:08:29.869Z","etag":null,"topics":["3d-engine","3d-graphics","cpp","javascipt","react","sorting","sorting-algorithm-visualizations","sorting-algorithms","sorting-visualization","surface-plot","v8-javascript-engine"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/alexandreLamarre.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-11T23:41:14.000Z","updated_at":"2023-08-09T00:07:55.000Z","dependencies_parsed_at":"2024-05-01T13:16:14.822Z","dependency_job_id":"5cca3905-3a6d-4f06-9915-6644919215e2","html_url":"https://github.com/alexandreLamarre/SortVisualizer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alexandreLamarre/SortVisualizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandreLamarre%2FSortVisualizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandreLamarre%2FSortVisualizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandreLamarre%2FSortVisualizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandreLamarre%2FSortVisualizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexandreLamarre","download_url":"https://codeload.github.com/alexandreLamarre/SortVisualizer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandreLamarre%2FSortVisualizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32704656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["3d-engine","3d-graphics","cpp","javascipt","react","sorting","sorting-algorithm-visualizations","sorting-algorithms","sorting-visualization","surface-plot","v8-javascript-engine"],"created_at":"2024-11-12T05:03:31.980Z","updated_at":"2026-05-06T17:35:29.729Z","avatar_url":"https://github.com/alexandreLamarre.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sort Algorithm Visualizer\n\nIn general, sorting algorithms take an array of numbers, usually integers, and sort them in ascending(or descending) order.\n\nThis project is a web-app that visualizes 12+ common sorting algorithms using 1 dimensional data. It uses several interchangeable methods for linear data visualization.\n\n\n| Example of merge sort | Example of dual pivot quick sort | Example of tim sort | Example of radix sort |\n| :-------------------: | :------------------------------: | :-----------------: | :-------------------: |\n| \u003cvideo controls = \"true\"\u003e \u003csource src =\"./examples/mergesort.mp4\" type = \"video/mp4\"/\u003e\u003c/video\u003e|\u003cvideo controls = \"true\"\u003e \u003csource src =\"./examples/dualquicksort.mp4\" type = \"video/mp4\"/\u003e\u003c/video\u003e|\u003cvideo controls = \"true\"\u003e \u003csource src =\"./examples/timsort.mp4\" type = \"video/mp4\"/\u003e\u003c/video\u003e|\n\u003cvideo controls = \"true\"\u003e \u003csource src =\"./examples/radixsort.mp4\" type = \"video/mp4\"/\u003e\u003c/video\u003e|\n\n## Table of contents\n\n- [Visualization Types](#Visualization-Types)\n  - [2D](#2D)\n    - [Scatter Plot](#Scatter-plot)\n    - [Swirl Dots](#Swirl-dots)\n    - [Disparity Dots](#Disparity-dots)\n  - [3D](#3D)\n- [Algorithms](#Algorithms)\n  - [Summary](#Summary)\n  - **Insertion Family**\n    - [Insertion sort](#Insertion-sort)\n    - [Binary insertion sort](#Binary-insertion-sort)\n  - **Merge family**\n    - [Merge sort](#Merge-sort)\n  - **Selection family**\n    - [Selection sort](#Selection-sort)\n    - [Heap sort](#Heap-sort)\n    - [Ternary heap sort](#Ternary-heap-sort)\n  - **Exchange family**\n    - [Quick sort](#Quick-sort)\n    - [Dual pivot quick sort](#Dual-pivot-quick-sort)\n  - **Non-comparison family**\n    - [Counting sort](#Counting-sort)\n    - [Radix sort(base 4)](#Radix-sort)\n  - **Hybrid family**\n    - [Tim sort](#Tim-sort)\n    - [Intro sort](#Intro-sort)\n- [References](#References)\n\n### Visualization-Types\n\n### 2D\n- [Scatter plot](#Scatter-plot)\n- [Swirl dots](#Swirl-dots)\n- [Disparity dots](#Disparity-dots)\n\n#### Scatter plot\n\nScatter plots use cartesian coordinates to plot data. The data's value is plotted to the y axis and the data's index is plotted to the x axis.\n\n\n\nRandom data (left) | Sorted data (right) |\n| :-------------:  | :-----------------: |\n|\u003cimg src=\"./examples/scatterRandom.jpg\"\u003e|\u003cimg src=\"./examples/scatterSorted.jpg\"\u003e|\n\n#### Swirl dots\n\nSwirl dots use polar coordinates to plot data. The data's values is plotted as a function of the radius and the data's index is plotted as the angle.\n\nRandom data (left) | Sorted data (right) |\n| :-------------:  | :-----------------: |\n| \u003cimg src = \"./examples/swirlRandom.jpg\" \u003e| \u003cimg src =\"./examples/swirlSorted.jpg\"\u003e                     |\n\n#### Disparity dots\n\nDisparity dots don't use a traditional coordinate system to plot data. The data's position, along the radius of the polar coordinate system, are plotted as the difference between their\ncurrent position in the data array and the correct position in the sorted array. The data's position, along the angle of polar of the polar coordinate system is given by the data's index in the array.\n\n\nRandom data (left) | Sorted data (right) |\n| :-------------:  | :-----------------: |\n| \u003cimg src = \"./examples/disparityRandom.jpg\"\u003e | \u003cimg src=\"./examples/disparitySorted.jpg\"\u003e|\n\n### 3D\n\nIn progress.\n\n### Algorithms\n\n#### Summary\n\n| Algorithms | Time Complexity | Space Complexity | Auxiliary Space Complexity |Stable | Approximate runtimes(2048)|\n| ---------- | :-------------: | :--------------: | :------------------------: | :----: | :-----------------------: |\n| Insertion sort | O(n^2)      | O(n)| O(1) | Yes | 139ms |\n| Binary insertion sort | O(n^2) | O(n) | O(1) | Yes | 293ms |\n| Merge sort | O(nlog(n)) | O(n) | O(1) | Yes | 15ms |\n| Selection sort | O(n^2) | O(n) | O(1) | No | 226ms |\n| Heap sort | O(nlog(n)) | O(n) | O(1) | Yes | 5ms |\n| Ternary heap sort | O(nlog(n)) | O(n) | O(1) | Yes | 9ms |\n| Quick sort | O(n^2) | O(n) | O(1) | No | 7ms |\n| Dual pivot quick sort | O(n^2) | O(n) | O(1) | No | 6ms |\n| Counting sort | O(n+ k), k = possible values in array | O(n) | O(n+k) | Yes | 2ms | \n| Radix sort | O(nk) k = radix base | O(n) | O(n+k) | Yes | 11ms |\n| Tim sort | O(nlog(n)) | O(n) | O(1) | Yes | 13ms | \n| Intro sort | O(nlog(n)) | O(n) | O(1) | Yes | 6ms |\n\n### Insertion Family\n\n#### Insertion sort\n\nPseudocode: \n\n``` \ninsertionSort(A):\n  for i = 1 to length(A):\n    let key = A[i]\n    let j = i\n    \n    while(j \u003e 0 and A[j-1] \u003e key):\n      A[j] = A[j-1]\n      j--\n     \n     A[j] = key\n  \n```\n#### Binary insertion sort\n\nPseudocode:\n\n``` \nbinaryInsertionSort(A):\n  for i = 1 to length(A):\n    let key = A[i]\n    let j = i\n    \n    let pivot = binarySearch(A[0:j], key)\n    while(j \u003e 0 and j \u003e= pivot):\n      A[j] = A[j-1]\n      j--\n    \n    A[j] = key\n    \nbinarySearch(A, value):\n  let pivot = length(A)/2\n  \n  if(A[pivot] === value) return pivot\n  if(A[pivot] \u003c value) binarySearch(A[pivot+1:length(A)])\n  if(A[pivot] \u003e value) binarySearch(A[0:pivot])\n```\n\n### Merge family\n\n#### Merge sort\n\nPseudocode:\n\n``` \nmergeSort(A):\n  let pivot = length(A)/2\n  mergeSort(A[0:pivot])\n  mergeSort(A[pivot:-1])\n  \n  return mergeA[0:pivot], A[pivot:-1])\n  \n```\n\n### Selection family\n\n#### Selection sort\n\nPseudocode:\n\n``` \nselectionSort(A):\n  for i = 1 to length(A):\n    let min = i\n    \n    for j = i+1 to n:\n      if(A[j] \u003c A[min]):\n        min = j\n    \n    if min != i :\n      swap(A[min], A[i])\n  \n```\n\n#### Heap sort\n\nPseudocode:\n\n```\nheapSort(A):\n  buildMaxHeap(A)\n  sort(A)\n\nbuildMaxHeap(A):\n  for i = length(A)/2 -1 to 1:\n    heapify(A, length(A), i)\n\nsort(A):\n  for i = length(A) - 1 to 1:\n    swap(A[0], A[i])\n    heapify(A, i, 0)\n    \nheapify(A, size, i):\n  let largest = i\n  let left = 2*i + 1\n  let right = 2*i + 2\n  if(left \u003c size and A[left] \u003e A[largest]):\n    largest = left;\n  if(right \u003c size and A[right] \u003e A[largest]):\n    largest = right;\n  if(largest != i):\n    swap(A, i, largest)\n    heapify(A, size, largest)\n```\n\n#### Ternary heap sort\n\nPseudocode:\n\n``` \nternaryHeapSort(A):\n  buildMaxHeap(A)\n  sort(A)\n\nbuildMaxHeap(A):\n  for let i = n/3 to 0:\n    ternaryHeapify(A, length(A), i-1)\n    \nsort(A):\n  for i = length(A)-1 to 1:\n    swap(A[0], A[i])\n    ternaryHeapify(A, i, 0)\n\nternaryHeapify(A, size, i):\n  let largest = i\n  let left = 3*i + 1\n  let middle = 3*i + 2\n  let right =  3*i + 3\n  \n  if left \u003c size and A[left] \u003e A[largest]:\n    largest = left\n  if right \u003c size and A[right] \u003e A[largest]:\n    largest = right\n  if middle \u003c size and A[middle] \u003e A[largest]:\n    largest = middle\n  if(largest != i):\n    swap(A[i], A[largest])\n    ternaryHeapify(A, size, largest)\n  \n```\n\n### Exchange family\n\n#### Quick sort\n\nPseudocode:\n\n```\nquickSort(A):\n  if length(A) \u003c= 1: return\n  \n  pivot = partition(A) \n  \n  quickSort(A[0:pivot])\n  quickSort(A[pivot:-1])\n\npartition(A):\n  let pivot = choosePivot(A)//  choose a pivot using some algorithm/heurisitic\n  \n  let i = 0\n  for j = 1 to length(A)-1:\n    if(A[j] \u003c pivot):\n      i++\n      swap(A[j], A[i])\n      \n  swap(A[i+1], A[-1])\n```\n\n#### Dual pivot quick sort\n\n``` \ndualQuickSort(A):\n  pivot1, pivot2 = partition(A) //choose two pivots and swap as necessary \n  \n  dualQuickSort(A[0:pivot1])\n  dualQuickSort(A[pivot1:pivot2])\n  dualQuickSort(A[pivot2:-1])\n\n\npartition(A):\n  \n```\n\n### Non-comparison family\n\n#### Counting sort\n\n#### Radix sort(base 4)\n\n### Hybrid family\n\n#### Tim sort\n\n#### Intro sort\n\n\n### References\n\n- Cormen, Thomas H., et al. **Introduction to algorithms**. MIT press, 2009.\n- Eberly, David. **3D game engine design: a practical approach to real-time computer graphics**. CRC Press, 2006.\n\n\n\u003c!-- # Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `yarn start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in the browser.\n\nThe page will reload if you make edits.\\\nYou will also see any lint errors in the console.\n\n### `yarn test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `yarn build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `yarn eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can’t go back!**\n\nIf you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.\n\nYou don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `yarn build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n\n--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexandrelamarre%2Fsortvisualizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexandrelamarre%2Fsortvisualizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexandrelamarre%2Fsortvisualizer/lists"}