Skip to content

taehoonjth/sort-algorithm-speedtest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 

Repository files navigation

Sort algorithm speed test

To list up all of the sort algorithms, and run speed test

List of sort algorithms

Getting Started

Installing

git clone https://github.com/Taehoonjth/sort-algorithm-speedtest.git && cd sort-algorithm-speedtest 

Running the test

Run sort.js

node sort.js 

And the result will be

Start sorting the 30000 elements of an array bubbleSort took 1547 millisecond bubbleSort_2 took 1818 millisecond selectionSort took 1391 millisecond iterativeMergeSort took 42 millisecond quickSort took 16 millisecond heapSort_TopDown_SiftDown took 7 millisecond heapSort_TopDown_SiftUP took 9 millisecond heapSort_BottomUP took 9 millisecond The winner is heapSort_TopDown_SiftDown Test is over. [Finished in 4.9s] 

You can also change a number of elements of an array for speed test by changing the first parameter of sortAlgorithmTester function(Be careful! This could blow your computer up!)

sortAlgorithmTester(30000, ...); ---> sortAlgorithmTester(50000, ...); 

Contributing

You can add more sort algorithms or better implementation of the same algorithm. When you add your sort function, please name it algorithm_yourName and add your function to sortAlgorithmTester as a parameter. For example...

sortAlgorithmTester(30000, bubbleSort, selectionSort, iterativeMergeSort, quickSort, YOUR FUNCTION!); 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors