programming-examples/js/Algorithms
2019-11-15 12:59:38 +01:00
..
3-way-string-quicksort.js Initial commit 2019-11-15 12:59:38 +01:00
avl-tree.js Initial commit 2019-11-15 12:59:38 +01:00
bellman-ford.js Initial commit 2019-11-15 12:59:38 +01:00
bfs.js Initial commit 2019-11-15 12:59:38 +01:00
binary-search-tree.js Initial commit 2019-11-15 12:59:38 +01:00
binarysearch.js Initial commit 2019-11-15 12:59:38 +01:00
bresenham-line-drawing.js Initial commit 2019-11-15 12:59:38 +01:00
bubblesort.js Initial commit 2019-11-15 12:59:38 +01:00
bucketsort.js Initial commit 2019-11-15 12:59:38 +01:00
cartesianproduct.js Initial commit 2019-11-15 12:59:38 +01:00
combinations.js Initial commit 2019-11-15 12:59:38 +01:00
countingsort.js Initial commit 2019-11-15 12:59:38 +01:00
dfs.js Initial commit 2019-11-15 12:59:38 +01:00
dijkstra.js Initial commit 2019-11-15 12:59:38 +01:00
edge.js Initial commit 2019-11-15 12:59:38 +01:00
fibonacci.js Initial commit 2019-11-15 12:59:38 +01:00
fisheryates.js Initial commit 2019-11-15 12:59:38 +01:00
floyd-warshall.js Initial commit 2019-11-15 12:59:38 +01:00
hanoi.js Initial commit 2019-11-15 12:59:38 +01:00
hash-table.js Initial commit 2019-11-15 12:59:38 +01:00
heap.js Initial commit 2019-11-15 12:59:38 +01:00
heapsort.js Initial commit 2019-11-15 12:59:38 +01:00
insertion-binary-sort.js Initial commit 2019-11-15 12:59:38 +01:00
insertionsort.js Initial commit 2019-11-15 12:59:38 +01:00
interval-tree.js Initial commit 2019-11-15 12:59:38 +01:00
is-prime.js Initial commit 2019-11-15 12:59:38 +01:00
knuth-morris-pratt.js Initial commit 2019-11-15 12:59:38 +01:00
levenshtein-distance.js Initial commit 2019-11-15 12:59:38 +01:00
linked-list.js Initial commit 2019-11-15 12:59:38 +01:00
longest-common-subsequence.js Initial commit 2019-11-15 12:59:38 +01:00
longest-increasing-subsequence.js Initial commit 2019-11-15 12:59:38 +01:00
lsd.js Initial commit 2019-11-15 12:59:38 +01:00
LZW.js Initial commit 2019-11-15 12:59:38 +01:00
maximum-subarray-divide-and-conquer.js Initial commit 2019-11-15 12:59:38 +01:00
maximum-subarray.js Initial commit 2019-11-15 12:59:38 +01:00
mergesort.js Initial commit 2019-11-15 12:59:38 +01:00
min-coins-change.js Initial commit 2019-11-15 12:59:38 +01:00
msd.js Initial commit 2019-11-15 12:59:38 +01:00
oddeven-sort.js Initial commit 2019-11-15 12:59:38 +01:00
permutations.js Initial commit 2019-11-15 12:59:38 +01:00
prim.js Initial commit 2019-11-15 12:59:38 +01:00
prime-factor-tree.js Initial commit 2019-11-15 12:59:38 +01:00
quickfind.js Initial commit 2019-11-15 12:59:38 +01:00
quickselect.js Initial commit 2019-11-15 12:59:38 +01:00
quicksort-middle.js Initial commit 2019-11-15 12:59:38 +01:00
quicksort.js Initial commit 2019-11-15 12:59:38 +01:00
quickunion.js Initial commit 2019-11-15 12:59:38 +01:00
radixsort.js Initial commit 2019-11-15 12:59:38 +01:00
readme.js Initial commit 2019-11-15 12:59:38 +01:00
recursive-binarysearch.js Initial commit 2019-11-15 12:59:38 +01:00
recursive-insertionsort.js Initial commit 2019-11-15 12:59:38 +01:00
red-black-tree.js Initial commit 2019-11-15 12:59:38 +01:00
richarddurstenfeld.js Initial commit 2019-11-15 12:59:38 +01:00
runlength.js Initial commit 2019-11-15 12:59:38 +01:00
selectionsort.js Initial commit 2019-11-15 12:59:38 +01:00
shellsort.js Initial commit 2019-11-15 12:59:38 +01:00
sieve-of-eratosthenes.js Initial commit 2019-11-15 12:59:38 +01:00
size-balanced-tree.js Initial commit 2019-11-15 12:59:38 +01:00
splay-tree.js Initial commit 2019-11-15 12:59:38 +01:00
suffix-tree.js Initial commit 2019-11-15 12:59:38 +01:00
tarjan-connected-components.js Initial commit 2019-11-15 12:59:38 +01:00
topological-sort.js Initial commit 2019-11-15 12:59:38 +01:00
variations-repetition.js Initial commit 2019-11-15 12:59:38 +01:00
vertex.js Initial commit 2019-11-15 12:59:38 +01:00
weightquickunion.js Initial commit 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)                                      |              |