a very bried conclusion on quicksort and shellsort.

This commit is contained in:
Shine wOng
2019-10-13 16:01:54 +08:00
parent 219246cb9c
commit 41b6637d3b
3 changed files with 38 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
QuickSort总结
============
## QuickSort基本思路
+ 分而治之的策略类似于Mergesort
+ 但是与Mergesort不同的是Quicksort是在划分的时候做文章主要操作是划分partition操作而Mergesort划分的时候直接简单划分主要操作是合并merge操作。
+ 递归实现
## 轴点的构造
+ 简单取第一个元素
+ 随机选取
+ 三者取中法
## 划分的策略
+ 版本一:难以应对退化的情形
+ 版本二:可以处理退化,但是稳定性更差
+ 版本三:稳定性更好,但是仍然是不稳定的算法。不能应对退化情形
## 平均情况下时间复杂度的证明

View File

@@ -0,0 +1,16 @@
Shellsort总结
============
## ShellSort基本概念
以不同的步长进行多次插入排序。它的时间性能主要受到步长的选取的影响
## 步长的选择
+ 说明shell序列的缺点
+ 邮资问题
+ g-有序的向量经过h-排序后仍然保持g-有序的证明(习题集)
+ 利用上述结论,可以证明几个序列的时间复杂度
- Papernov
- Pratt
- Sedgewick

View File

@@ -1349,5 +1349,3 @@ Some Words
- Lucy soothed the baby by rocking it in her arms.
- She made a cup of tea to soothe her nerves.
- Massage can gently soothe away your aches and pains.