Giter VIP home page Giter VIP logo

kluzko / visualization-of-sorting-alogrithms Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 3.0 648 KB

Visualization of popular sorting alogrithms using typescript and d3.js

Home Page: https://kluzko.github.io/Visualization-of-sorting-alogrithms/

License: MIT License

HTML 11.01% TypeScript 60.80% CSS 27.74% JavaScript 0.44%
d3js javascript sorting-algorithms sorting-visualization typescript vizualisation learn

visualization-of-sorting-alogrithms's Introduction

Sorting Algorithms Visualization

This project uses d3.js and TypeScript to create visualizations of the following sorting algorithms:

  • Bubble sort
  • Selection sort
  • Insertion sort
  • Merge sort
  • Quick sort
  • Radix sort
  • Bucket sort

Website demonstartion

You can visit the website here https://kluzko.github.io/Visualization-of-sorting-alogrithms

In progress

  • first thing to change is make visualization more responsive so I can add bigger number of numbers (maybe 2500)
  • add slider to adjust animation speed ( now is as fast as possible )

Run the project

If you want to run project localy on your computer these are the steps:

  1. Clone the repository
  2. Run npm install to install the necessary dependencies
  3. Run npm run dev then visit http://localhost:5173/

Usage

Select an algorithm from the dropdown menu and hit the "start" button to see the visualization in action. You can also change the amount of data so far from 50 to 500 numbers.

Speed comparsion on the website

Warning This comparsion is only based on test on this website if you really want to test speed of this alogrithms you should delete await delay() witch is crucial for performance of vizualisation. For example with delay Radix Sort for 500 numbers is 22.15s but without this delay you get 0.75s ! So this is just to show you the speed comparison with these slowdowns.

Values are the average of 5 tests

Algoritms 50 numbers 100 numbers 250 numbers 500 numbers
Bubble Sort ≈ 9.34s ≈ 40.24s  ≈ 198.56s ≈ 1310.26s
Selection Sort ≈ 0.76s ≈ 1.55s ≈ 3.88s ≈ 7.81s
Insertion Sort ≈ 0.76s ≈ 1.54s ≈ 3.89s ≈ 7.81s
Merge Sort ≈ 2.33s ≈ 3.08s ≈ 8.17s ≈ 19.68s
Quick Sort ≈ 1.66s ≈ 2.54s ≈ 7.57s ≈ 14.45s
Radix Sort ≈ 1.48s ≈ 2.88s ≈ 12.80s ≈ 22.15s
Bucket Sort ≈ 0.79s ≈ 1.49s ≈ 4.04s ≈ 6.70s

Note These values may vary depending on your computer it also depends on how sorted numbers you get.

But as you can see Bubble Sort is very inefficent alogrithm.

See LEARN.md for more information

To gain a deeper understanding of the sorting algorithms implemented in this project, please refer to the LEARN.md file.

Contributions

If you find any issue, please open an issue or pull request. Also if you want to add any new algorithm or improve the existing algorithm please let me know.

visualization-of-sorting-alogrithms's People

Contributors

kluzko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.