按下标的一定增量分组,对每组使用直接插入算法排序;随着增量*逐渐减少,每组包含的关键字越来越多,当增量减至1时,整个文件恰*好被分成一组,算法便终止。*8,9,1,7,2,3,5,4,6,0*//初始增量gap=length/2=5,向下取整,分为5组,下标[i]和[i+5]进行比较*3,5,1,6,0,8,9,4,7,2*//缩小增量gap=5/2=2,分为2组,下标[i],[i+2],[i+4],[i+6],[i+8]*0,2,1,4,3,5,7,6,9,8*//在缩小增量gap=2/2=1,分为1组*0,1,2,3,4,5,6,7,8,9