auto commit

This commit is contained in:
CyC2018
2019-04-21 15:53:21 +08:00
parent df394162f9
commit 0824b5a750
6 changed files with 9 additions and 8 deletions

View File

@ -138,13 +138,11 @@ public class Insertion<T extends Comparable<T>> extends Sort<T> {
# 希尔排序
对于大规模的数组,插入排序很慢,因为它只能交换相邻的元素,每次只能将逆序数量减少 1。
希尔排序的出现就是为了解决插入排序的这种局限性,它通过交换不相邻的元素,每次可以将逆序数量减少大于 1。
对于大规模的数组,插入排序很慢,因为它只能交换相邻的元素,每次只能将逆序数量减少 1。希尔排序的出现就是为了解决插入排序的这种局限性,它通过交换不相邻的元素,每次可以将逆序数量减少大于 1。
希尔排序使用插入排序对间隔 h 的序列进行排序。通过不断减小 h最后令 h=1就可以使得整个数组是有序的。
<div align="center"> <img src="https://gitee.com/CyC2018/CS-Notes/raw/master/docs/pics/cb5d2258-a60e-4364-94a7-3429a3064554_200.png"/> </div><br>
<div align="center"> <img src="https://gitee.com/CyC2018/CS-Notes/raw/master/docs/pics/38ce21e9-2075-41a3-862b-f3265a082132_200.png"/> </div><br>
```java
public class Shell<T extends Comparable<T>> extends Sort<T> {