Update READMEs.

This commit is contained in:
Oleksii Trekhleb 2018-04-13 17:16:35 +03:00
parent db4a57b8da
commit f26fd87c0a
2 changed files with 10 additions and 9 deletions

View File

@ -93,12 +93,13 @@ Source: [Big O Cheat Sheet](http://bigocheatsheet.com/).
### Array Sorting Algorithms Complexity
![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/).
| Name | Best | Average | Worst | Memory | Stable | Method |
| --------------------- | :-------: | :-------: | :-------: | :-------: | :-------: | :------------ |
| **Bubble sort** | n | n^2 | n^2 | 1 | Yes | Exchanging |
| **Insertion sort** | n | n^2 | n^2 | 1 | Yes | Insertion |
| **Selection sort** | n^2 | n^2 | n^2 | 1 | No | Selection |
| **Heap sort** | n log(n) | n log(n) | n log(n) | 1 | No | Selection |
| Name | Best | Average | Worst | Memory | Stable |
| --------------------- | :-------: | :-------: | :-------: | :-------: | :-------: |
| **Bubble sort** | n | n^2 | n^2 | 1 | Yes |
| **Insertion sort** | n | n^2 | n^2 | 1 | Yes |
| **Selection sort** | n^2 | n^2 | n^2 | 1 | No |
| **Heap sort** | n log(n) | n log(n) | n log(n) | 1 | No |
| **Merge sort** | n log(n) | n log(n) | n log(n) | n | Yes |
| **Quick sort** | n log(n) | n log(n) | n^2 | log(n) | No |
| **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