GeezerVison is showing github.com — Update READMEs. · BrandonWeb/javascript-algorithms@619c58e
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: src/algorithms/sorting/bubble-sort/README.md +3-10Lines changed: 3 additions & 10 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -11,16 +11,9 @@ are needed, which indicates that the list is sorted. | 11 | 11 |
| 12 | 12 | ## Complexity | 13 | 13 |
| 14 | | -Time | 15 | | - | 16 | | -- worst _O_(_n_<sup>2</sup>), | 17 | | -- best _O_(_n_), | 18 | | -- average _O_(_n_<sup>2</sup>) | 19 | | - | 20 | | -Space | 21 | | - | 22 | | -worst _O_(1) auxiliary | 23 | | - | | 14 | +| Name | Best | Average | Worst | Memory | Stable | Comments | | | 15 | +| --------------------- | :-------------: | :-----------------: | :-----------------: | :-------: | :-------: | :-------- | | | 16 | +| **Bubble sort** | n | n<sup>2</sup> | n<sup>2</sup> | 1 | Yes | | | 24 | 17 |
| 25 | 18 | ## References | 26 | 19 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/algorithms/sorting/counting-sort/README.md +3-3Lines changed: 3 additions & 3 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 56 | 56 |
| 57 | 57 | ## Complexity | 58 | 58 |
| 59 | | -###### time: worst _O_(_n_ + _k_), best _O_(_n_), average _O_(_n_ + _k_) where _n_ is the number of elements in the input array and _k_ is the range of the output. | 60 | | - | 61 | | -###### space: worst _O_(_n_ + _k_) | | 59 | +| Name | Best | Average | Worst | Memory | Stable | Comments | | | 60 | +| --------------------- | :-------------: | :-----------------: | :-----------------: | :-------: | :-------: | :-------- | | | 61 | +| **Counting sort** | n + r | n + r | n + r | n + r | Yes | r - biggest number in array | | 62 | 62 |
| 63 | 63 | ## References | 64 | 64 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/algorithms/sorting/heap-sort/README.md +3-3Lines changed: 3 additions & 3 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -15,9 +15,9 @@ rather than a linear-time search to find the maximum. | 15 | 15 |
| 16 | 16 | ## Complexity | 17 | 17 |
| 18 | | -###### time: worst _O_(_n log n_), best _O_(_n log n_), average _O_(_n log n_) | 19 | | - | 20 | | -###### space: worst _O_(1) auxiliary | | 18 | +| Name | Best | Average | Worst | Memory | Stable | Comments | | | 19 | +| --------------------- | :-------------: | :-----------------: | :-----------------: | :-------: | :-------: | :-------- | | | 20 | +| **Heap sort** | n log(n) | n log(n) | n log(n) | 1 | No | | | 21 | 21 |
| 22 | 22 | ## References | 23 | 23 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/algorithms/sorting/insertion-sort/README.md +3-4Lines changed: 3 additions & 4 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 12 | 12 |
| 13 | 13 | ## Complexity | 14 | 14 |
| 15 | | -###### time: worst _O_(_n_<sup>2</sup>), best _O_(_n_), average _O_(_n_<sup>2</sup>) | 16 | | - | 17 | | -###### space: worst _O_(1) auxiliary | 18 | | - | | 15 | +| Name | Best | Average | Worst | Memory | Stable | Comments | | | 16 | +| --------------------- | :-------------: | :-----------------: | :-----------------: | :-------: | :-------: | :-------- | | | 17 | +| **Insertion sort** | n | n<sup>2</sup> | n<sup>2</sup> | 1 | Yes | | | 19 | 18 |
| 20 | 19 | ## References | 21 | 20 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/algorithms/sorting/merge-sort/README.md +3-3Lines changed: 3 additions & 3 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -24,9 +24,9 @@ emulate merge sort (top-down). | 24 | 24 |
| 25 | 25 | ## Complexity | 26 | 26 |
| 27 | | -###### time: average _O_(_n log n_) | 28 | | - | 29 | | -###### space: worst _O_(_n_) | | 27 | +| Name | Best | Average | Worst | Memory | Stable | Comments | | | 28 | +| --------------------- | :-------------: | :-----------------: | :-----------------: | :-------: | :-------: | :-------- | | | 29 | +| **Merge sort** | n log(n) | n log(n) | n log(n) | n | Yes | | | 30 | 30 |
| 31 | 31 | ## References | 32 | 32 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/algorithms/sorting/quick-sort/README.md +3-3Lines changed: 3 additions & 3 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -25,9 +25,9 @@ The horizontal lines are pivot values. | 25 | 25 |
| 26 | 26 | ## Complexity | 27 | 27 |
| 28 | | -###### time: worst _O_(_n_<sup>2</sup>), best _O_(_n log n_), average _O_(_n log n_) | 29 | | - | 30 | | -###### space: worst _O_(_n_) auxiliary | | 28 | +| Name | Best | Average | Worst | Memory | Stable | Comments | | | 29 | +| --------------------- | :-------------: | :-----------------: | :-----------------: | :-------: | :-------: | :-------- | | | 30 | +| **Quick sort** | n log(n) | n log(n) | n<sup>2</sup> | log(n) | No | | | 31 | 31 |
| 32 | 32 | ## References | 33 | 33 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/algorithms/sorting/radix-sort/README.md +3-3Lines changed: 3 additions & 3 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -27,9 +27,9 @@ comparison-based sorts (and worse if keys are much longer than `log n`). | 27 | 27 |
| 28 | 28 | ## Complexity | 29 | 29 |
| 30 | | -###### time: worst _O_(_n_), best _O_(_n_), average _O_(_n_) | 31 | | - | 32 | | -###### space: always _O_(_n_) | | 30 | +| Name | Best | Average | Worst | Memory | Stable | Comments | | | 31 | +| --------------------- | :-------------: | :-----------------: | :-----------------: | :-------: | :-------: | :-------- | | | 32 | +| **Radix sort** | n * k | n * k | n * k | n + k | Yes | k - length of longest key | | 33 | 33 |
| 34 | 34 | ## References | 35 | 35 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/algorithms/sorting/selection-sort/README.md +3-3Lines changed: 3 additions & 3 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -15,9 +15,9 @@ memory is limited. | 15 | 15 |
| 16 | 16 | ## Complexity | 17 | 17 |
| 18 | | -###### time: worst _O_(_n_<sup>2</sup>), best _O_(_n_<sup>2</sup>), average _O_(_n_<sup>2</sup>) | 19 | | - | 20 | | -###### space: _O_(1) auxiliary | | 18 | +| Name | Best | Average | Worst | Memory | Stable | Comments | | | 19 | +| --------------------- | :-------------: | :-----------------: | :-----------------: | :-------: | :-------: | :-------- | | | 20 | +| **Selection sort** | n<sup>2</sup> | n<sup>2</sup> | n<sup>2</sup> | 1 | No | | | 21 | 21 |
| 22 | 22 | ## References | 23 | 23 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/algorithms/sorting/shell-sort/README.md +3-3Lines changed: 3 additions & 3 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -44,9 +44,9 @@ Shell sort uses insertion sort to sort the array. | 44 | 44 |
| 45 | 45 | ## Complexity | 46 | 46 |
| 47 | | -###### time: best _O_(_n log n_), average - depends on 'gap sequence'. | 48 | | - | 49 | | -###### space: worst _O_(_n_) total, _O_(1) auxiliary | | 47 | +| Name | Best | Average | Worst | Memory | Stable | Comments | | | 48 | +| --------------------- | :-------------: | :-----------------: | :-----------------: | :-------: | :-------: | :-------- | | | 49 | +| **Shell sort** | n log(n) | depends on gap sequence | n (log(n))<sup>2</sup> | 1 | No | | | 50 | 50 |
| 51 | 51 | ## References | 52 | 52 |
| |
|