c++几种基本的插入排序(图文)(2)
4.example code: int main(){ int i; int a[] = {80, 93, 60, 12, 42, 30, 68, 85, 10}; InsertSort(a, sizeof(a)/sizeof(a[0])); for(i = 0; i sizeof(a)/sizeof(a[0]); ++i) printf("%d ", a[i]); printf("\n");
4.example code:
int main() { int i; int a[] = {80, 93, 60, 12, 42, 30, 68, 85, 10}; InsertSort(a, sizeof(a)/sizeof(a[0])); for(i = 0; i < sizeof(a)/sizeof(a[0]); ++i) printf("%d ", a[i]); printf("\n"); BinsertSort(a, sizeof(a)/sizeof(a[0])); for(i = 0; i < sizeof(a)/sizeof(a[0]); ++i) printf("%d ", a[i]); printf("\n"); ShellSort(a, sizeof(a)/sizeof(a[0])); for(i = 0; i < sizeof(a)/sizeof(a[0]); ++i) printf("%d ", a[i]); printf("\n"); return 0; }
收藏文章
精彩图集
精彩文章