设待排序序列为{10,18,4,3,6,12,1,9,15,8}请写出希尔排序每一趟的结果。增量序列为5,3,2,1。
正确答案:初始:10,18,4,3,6,12,1,9,15,8
d=5:10,1,4,3,6,12,18,9,15,8
d=3:3,1,4,8,6,12,10,9,15,18
d=2:3,1,4,8,6,9,10,12,15,18
d=1:1,3,4,6,8,9,10,12,15,18
d=5:10,1,4,3,6,12,18,9,15,8
d=3:3,1,4,8,6,12,10,9,15,18
d=2:3,1,4,8,6,9,10,12,15,18
d=1:1,3,4,6,8,9,10,12,15,18
答案解析:有
![](/editor/images/201705/qrcode_for_gh_573e2a458573_258.jpg)
微信扫一扫手机做题