Skip to content

Commit

Permalink
feat: revise README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fiteen committed Dec 27, 2019
1 parent fdb1753 commit c1507e3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@

| 排序算法 | 时间复杂度 | 最差情况 | 最好情况 | 空间复杂度 | 稳定性 | 排序方式 |
| :-----------------------: | :--------: | :------: | :------: | :--------: | :----: | :-------: |
| [冒泡排序](BubbleSort) | O(n²) | O(n²) | O(n) | O(1)​ | 稳定 | In-place |
| [快速排序](QuickSort) | O(nlogn)​ | O(n²) | O(nlogn)​ | O(logn)​ | 不稳定 | In-place |
| [插入排序](InsertionSort) | O(n²) | O(n²) | O(n)​ | O(1)​ | 稳定 | In-place |
| [希尔排序](ShellSort) | O(nlog²n)​ | O(n²) | O(n)​ | O(1)​ | 不稳定 | In-place |
| [选择排序](SelectionSort) | O(n²) | O(n²) | O(n²) | O(1)​ | 不稳定 | In-place |
| [堆排序](HeapSort) | O(nlogn)​ | O(nlogn) | O(nlogn)​ | O(1)​ | 不稳定 | In-place |
| [归并排序](MergeSort) | O(nlogn)​ | O(nlogn) | O(nlogn)​ | O(n)​ | 稳定 | Out-place |
| [冒泡排序](BubbleSort) | O(n²) | O(n²) | O(n) | O(1)​ | | In-place |
| [快速排序](QuickSort) | O(nlogn)​ | O(n²) | O(nlogn)​ | O(logn)​ | | In-place |
| [插入排序](InsertionSort) | O(n²) | O(n²) | O(n)​ | O(1)​ | | In-place |
| [希尔排序](ShellSort) | O(nlog²n)​ | O(n²) | O(n)​ | O(1)​ | | In-place |
| [选择排序](SelectionSort) | O(n²) | O(n²) | O(n²) | O(1)​ | | In-place |
| [堆排序](HeapSort) | O(nlogn)​ | O(nlogn) | O(nlogn)​ | O(1)​ | | In-place |
| [归并排序](MergeSort) | O(nlogn)​ | O(nlogn) | O(nlogn)​ | O(n)​ | | Out-place |

**非比较类排序**:不通过比较来决定元素间的相对次序,其时间复杂度可以突破 O(nlogn),以线性时间运行。属于非比较类的有:

| 排序算法 | 时间复杂度 | 最差情况 | 最好情况 | 空间复杂度 | 稳定性 | 排序方式 |
| :----------------------: | :--------: | :-------: | :------: | :--------: | :----: | :-------: |
| [桶排序](BucketSort) | O(n+k)​ | O(n²) | O(n)​ | O(n+r)​ | 稳定 | Out-place |
| [计数排序](CountingSort) | O(n+k)​ | O(n+k)​ | O(n+k)​ | O(n+k)​ | 稳定 | Out-place |
| [基数排序](RadixSort) | O(d(n+r))​ | O(d(n+r)) | O(d(n+r)) | O(n+r)​ | 稳定 | Out-place |
| [桶排序](BucketSort) | O(n+k)​ | O(n²) | O(n)​ | O(n+r)​ | | Out-place |
| [计数排序](CountingSort) | O(n+k)​ | O(n+k)​ | O(n+k)​ | O(n+k)​ | | Out-place |
| [基数排序](RadixSort) | O(d(n+r))​ | O(d(n+r)) | O(d(n+r)) | O(n+r)​ | | Out-place |

**n**:待排序列的个数

Expand Down

0 comments on commit c1507e3

Please sign in to comment.