Skip to content

Commit f3aa4a1

Browse files
committed
Update READMEs.
1 parent b0247a5 commit f3aa4a1

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ Source: [Big O Cheat Sheet](http://bigocheatsheet.com/).
9696
![Big O of sorting algoritms](https://github.com/trekhleb/javascript-algorithms/blob/master/assets/big-o-sorting-algorithms.png)
9797
Source: [Big O Cheat Sheet](http://bigocheatsheet.com/).
9898

99-
| Name | Best | Average | Worst | Memory | Stable | Method | Notes |
100-
| --------------------- | :-----: | :-------: | :-----: | :-------: | :-------: | :------------ | :-------------- |
101-
| **Bubble sort** | n | n^2 | n^2 | 1 | Yes | Exchanging | Tiny code size |
102-
| **Insertion sort** | n | n^2 | n^2 | 1 | Yes | Insertion | O(n + d), in the worst case over sequences that have d inversions |
103-
| **Selection sort** | n^2 | n^2 | n^2 | 1 | No | Selection | Stable with O(n) extra space, for example using lists |
99+
| Name | Best | Average | Worst | Memory | Stable | Method | Notes |
100+
| --------------------- | :-------: | :-------: | :-------: | :-------: | :-------: | :------------ | :-------------- |
101+
| **Bubble sort** | n | n^2 | n^2 | 1 | Yes | Exchanging | Tiny code size |
102+
| **Insertion sort** | n | n^2 | n^2 | 1 | Yes | Insertion | O(n + d), in the worst case over sequences that have d inversions |
103+
| **Selection sort** | n^2 | n^2 | n^2 | 1 | No | Selection | Stable with O(n) extra space, for example using lists |
104+
| **Heap sort** | n log(n) | n log(n) | n log(n) | 1 | No | Selection | |

src/algorithms/sorting/bubble-sort/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ The pass through the list is repeated until no swaps
88
are needed, which indicates that the list is sorted.
99

1010
![Algorithm Visualization](https://upload.wikimedia.org/wikipedia/commons/c/c8/Bubble-sort-example-300px.gif)
11+
12+
## References
13+
14+
[Wikipedia](https://en.wikipedia.org/wiki/Bubble_sort)

src/algorithms/sorting/insertion-sort/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ sort.
1010

1111
![Algorithm Visualization](https://upload.wikimedia.org/wikipedia/commons/0/0f/Insertion-sort-example-300px.gif)
1212

13+
## References
14+
15+
[Wikipedia](https://en.wikipedia.org/wiki/Insertion_sort)

src/algorithms/sorting/selection-sort/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ memory is limited.
1212
![Algorithm Visualization](https://upload.wikimedia.org/wikipedia/commons/b/b0/Selection_sort_animation.gif)
1313

1414
![Algorithm Visualization](https://upload.wikimedia.org/wikipedia/commons/9/94/Selection-Sort-Animation.gif)
15+
16+
## References
17+
18+
[Wikipedia](https://en.wikipedia.org/wiki/Selection_sort)

0 commit comments

Comments
 (0)