希爾排序(Shell
void ShellInsert(SqList &L
for(i=dk+
if(LT(L
L
for(j=i
L
L
}
}//ShellInsert
void ShellSort(SqList &L
for(k=
ShellInsert(L
}//ShellSort
(四)交換排序
void bubble_Sort(int a[]
for(i=n
change=FALSE;
for(j=
if(a[j]>a[j+
A[j]>a[j+
change=TRUE;
}
}
}//bubble
【釋】每趟比較
返回《數據結構》考研復習精編
[
From:http://tw.wingwit.com/Article/program/sjjg/201311/23818.html