![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
排序
tara_int
我的程序成长史。
展开
-
C语言调用qsort函数
数组排序, 后续补充其他情况 #include <stdio.h> #include <stdlib.h> int cmpfunc(const void *a, const void *b) { return ( *(int*)a - *(int*)b); //升序 } /* int cmpfunc(const void *a, const voi...原创 2018-08-22 08:45:22 · 1122 阅读 · 0 评论 -
堆排序 数据结构实验之排序四:寻找大富翁
#include<stdio.h> #define INF 0x3f3f3f3f int n, m, a[15]; int size; int delete_max()//和插入思路很像,找到儿子比自己大的放在自己的位置,自己继续往下找,直到儿子都比自己小的时候,自己就坐定了 { int p, c, max, t; max = a[1]; //大顶堆,...翻译 2018-08-22 16:13:05 · 156 阅读 · 0 评论 -
希尔排序3403,归并排序3402, 交叉排序1591
希尔排序: #include <stdio.h> #include <stdlib.h> int a[10010]; int b[10010]; void shellsort1(int a[], int n) { int d, i, j, t; d = n/2; for(i = d; i < n; i++) { fo...原创 2018-08-20 16:50:47 · 124 阅读 · 0 评论