mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-14 06:52:59 +08:00
Add big O sheet for sorting algorithms.
This commit is contained in:
parent
79b091ae2e
commit
43353cd17c
@ -34,8 +34,6 @@
|
|||||||
* [Bubble Sort](https://github.com/trekhleb/javascript-algorithms/tree/master/src/algorithms/sorting/bubble-sort)
|
* [Bubble Sort](https://github.com/trekhleb/javascript-algorithms/tree/master/src/algorithms/sorting/bubble-sort)
|
||||||
* [Selection Sort](https://github.com/trekhleb/javascript-algorithms/tree/master/src/algorithms/sorting/selection-sort)
|
* [Selection Sort](https://github.com/trekhleb/javascript-algorithms/tree/master/src/algorithms/sorting/selection-sort)
|
||||||
|
|
||||||
<span style="color:blue">test</span>
|
|
||||||
|
|
||||||
## Running Tests
|
## Running Tests
|
||||||
|
|
||||||
**Run all tests**
|
**Run all tests**
|
||||||
@ -96,3 +94,9 @@ Source: [Big O Cheat Sheet](http://bigocheatsheet.com/).
|
|||||||
|
|
||||||
![Big O of sorting algoritms](https://github.com/trekhleb/javascript-algorithms/blob/master/assets/big-o-sorting-algorithms.png)
|
![Big O of sorting algoritms](https://github.com/trekhleb/javascript-algorithms/blob/master/assets/big-o-sorting-algorithms.png)
|
||||||
Source: [Big O Cheat Sheet](http://bigocheatsheet.com/).
|
Source: [Big O Cheat Sheet](http://bigocheatsheet.com/).
|
||||||
|
|
||||||
|
| Name | Best | Average | Worst | Memory | Stable | Method | Notes |
|
||||||
|
| ------------------| ------- | --------- | ------- | --------- | --------- | ------------- | --------------- |
|
||||||
|
| **Bubble sort** | _n_ | _n^2_ | _n^2_ | _1_ | _Yes_ | _Exchanging_ | Tiny code size. |
|
||||||
|
|
||||||
|
<span color="red">test</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user