分类 | 内容 | 时间复杂度 | 空间复杂度 | 算法稳定性 |
---|---|---|---|---|
选泡插 | 选择排序、冒泡排序、插入排序 | 平均 O(n^2) 最好 O(n) |
O(1) | 冒泡排序:稳定 选择排序:不稳定 插入排序:稳定 |
快归希堆 | 快速排序、归并排序、希尔排序、堆排序 | O(log(n)) | 快速排序:不稳定 归并排序:稳定 希尔排序:不稳定 堆排序:不稳定 |
|
桶计基 | 桶排序、计数排序、基数排序 | O(n) | 桶排序: 计数排序: 基数排序:稳定 |
keycasiter / sort-algorithm Goto Github PK
View Code? Open in Web Editor NEW排序算法整理