mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2025-07-08 10:24:54 +08:00
Update READMEs.
This commit is contained in:
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
|
||||||
|
|
||||||

|
| 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 |
Reference in New Issue
Block a user