mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-12-27 15:41:16 +08:00
Update READMEs.
This commit is contained in:
parent
db4a57b8da
commit
f26fd87c0a
19
README.md
19
README.md
@ -93,12 +93,13 @@ Source: [Big O Cheat Sheet](http://bigocheatsheet.com/).
|
|||||||
|
|
||||||
### Array Sorting Algorithms Complexity
|
### Array Sorting Algorithms Complexity
|
||||||
|
|
||||||
![Big O of sorting algoritms](https://github.com/trekhleb/javascript-algorithms/blob/master/assets/big-o-sorting-algorithms.png)
|
| Name | Best | Average | Worst | Memory | Stable |
|
||||||
Source: [Big O Cheat Sheet](http://bigocheatsheet.com/).
|
| --------------------- | :-------: | :-------: | :-------: | :-------: | :-------: |
|
||||||
|
| **Bubble sort** | n | n^2 | n^2 | 1 | Yes |
|
||||||
| Name | Best | Average | Worst | Memory | Stable | Method |
|
| **Insertion sort** | n | n^2 | n^2 | 1 | Yes |
|
||||||
| --------------------- | :-------: | :-------: | :-------: | :-------: | :-------: | :------------ |
|
| **Selection sort** | n^2 | n^2 | n^2 | 1 | No |
|
||||||
| **Bubble sort** | n | n^2 | n^2 | 1 | Yes | Exchanging |
|
| **Heap sort** | n log(n) | n log(n) | n log(n) | 1 | No |
|
||||||
| **Insertion sort** | n | n^2 | n^2 | 1 | Yes | Insertion |
|
| **Merge sort** | n log(n) | n log(n) | n log(n) | n | Yes |
|
||||||
| **Selection sort** | n^2 | n^2 | n^2 | 1 | No | Selection |
|
| **Quick sort** | n log(n) | n log(n) | n^2 | log(n) | No |
|
||||||
| **Heap sort** | n log(n) | n log(n) | n log(n) | 1 | No | Selection |
|
| **Radix sort** | nk | nk | nk | n + k | |
|
||||||
|
| **Bucket sort** | n + k | n + k | n^2 | n | |
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 209 KiB |
Loading…
Reference in New Issue
Block a user