programming-examples/js/Algorithms/readme.js

22 lines
1.9 KiB
JavaScript
Raw Normal View History

2019-11-15 12:59:38 +01:00
# Comparison of all sorting algorithms
| Algorithm | Complexity | When to use? |
|----------------------------|-----------------------------------------------------|--------------|
| 3-way-string-quicksort.js | O(N^2) | |
| bubblesort.js | O(N^2) | |
| bucketsort.js | O(N) | |
| countingsort.js | O(N) | |
| heapsort.js | O(N log N) | |
| insertion-binary-sort.js | O(N^2) | |
| insertionsort.js | O(N^2) | |
| lsd.js | O(N*M) for N keys which have M or fewer digits | |
| mergesort.js | O(n log(n)) | |
| msd.js | O(N*M) for N keys which have M or fewer digits | |
| oddeven-sort.js | O(N^2) | |
| quicksort-middle.js | O(N log(N)) | |
| quicksort.js | O(nlog n) | |
| radixsort.js | O(N K) for N keys with K being | |
| recursive-insertionsort.js | O(N^2) | |
| selectionsort.js | O(N^2) | |
| shellsort.js | O((nlog(n))^2) | |