Skip to content

Commit 1b8075c

Browse files
committed
Add big O sheet for sorting algorithms.
1 parent 468bf4a commit 1b8075c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,12 @@ Below is the list of some of the most used Big O notations and their performance
9090
![Common Data Structure Operations](https://github.com/trekhleb/javascript-algorithms/blob/master/assets/big-o-data-structures.png)
9191
Source: [Big O Cheat Sheet](http://bigocheatsheet.com/).
9292

93-
### Array Sorting Algorithms
93+
### Array Sorting Algorithms Complexity
9494

9595
![Big O of sorting algoritms](https://github.com/trekhleb/javascript-algorithms/blob/master/assets/big-o-sorting-algorithms.png)
9696
Source: [Big O Cheat Sheet](http://bigocheatsheet.com/).
9797

98-
| Name | Best | Average | Worst | Memory | Stable | Method | Notes |
99-
| ------------------| :-----: | :-------: | :-----: | :-------: | :-------: | :------------ | :-------------- |
100-
| **Bubble sort** | n | n^2 | n^2 | 1 | Yes | Exchanging | Tiny code size. |
98+
| Name | Best | Average | Worst | Memory | Stable | Method | Notes |
99+
| --------------------- | :-----: | :-------: | :-----: | :-------: | :-------: | :------------ | :-------------- |
100+
| **Bubble sort** | n | n^2 | n^2 | 1 | Yes | Exchanging | Tiny code size |
101+
| **Selection sort** | n^2 | n^2 | n^2 | 1 | No | Selection | Stable with O(n) extra space, for example using lists |

0 commit comments

Comments
 (0)