上一页 1 2 3 4 5 6 ··· 14 下一页
摘要: #include #include int n; /* * 分割使枢轴记录的左边元素比右边元素小 */ int Partition(int *array, int low, int high) { int pivotkey = array[low]; array[0] = array[low]; while (low = pivotkey) {... 阅读全文
posted @ 2019-05-24 20:21 Kxzh 阅读(111) 评论(0) 推荐(0) 编辑
摘要: #include #include int n; /* * 冒泡排序 */ void BubbleSort(int *array) { int i, j, temp; for (i = 0; i array[j + 1]) { temp = array[j]; array[j] ... 阅读全文
posted @ 2019-05-24 20:18 Kxzh 阅读(109) 评论(0) 推荐(0) 编辑
摘要: #include #include int n; /* * 希尔排序 */ void ShellSort(int *array) { int k = n / 2; //增量序列(仅作举例) while (k > 0) { int i, j; for (i = k + 1; i 0 && array[0] < array[j];... 阅读全文
posted @ 2019-05-24 20:16 Kxzh 阅读(96) 评论(0) 推荐(0) 编辑
摘要: #include #include int n; /* * 直接插入排序 */ void InsertSort(int *array) { int i, j; for (i = 2; i <= n; i++) { if (array[i] < array[i - 1]) { array[0] = arra... 阅读全文
posted @ 2019-05-24 20:15 Kxzh 阅读(84) 评论(0) 推荐(0) 编辑
摘要: #include #include int BinarySearch(int *array, int key, int low, int high) { int mid; while (low <= high) { mid = (low + high) / 2; if (key == array[mid]) { ... 阅读全文
posted @ 2019-05-24 20:13 Kxzh 阅读(112) 评论(0) 推荐(0) 编辑
摘要: #include #include #define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR 0 #define OVERFLOW -2 #define MAX_NUM 20 typedef int Status; typedef int QElemType; typedef char VexType; /* * 邻接表存储结... 阅读全文
posted @ 2019-05-24 20:07 Kxzh 阅读(1088) 评论(0) 推荐(0) 编辑
摘要: #include #include #define TRUE 1 #define FALSE 0 #define OVERFLOW -2 #define OK 1 #define ERROR 0 typedef int Status; typedef int TElemType; /* * 存储结构 */ typedef struct BiTNode { TElemType... 阅读全文
posted @ 2019-05-24 20:00 Kxzh 阅读(1361) 评论(0) 推荐(0) 编辑
摘要: #include #include #define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR 0 #define OVERFLOW -2 typedef int QElemType; typedef int Status; /* * 存储结构 */ typedef struct QNode { QElemType d... 阅读全文
posted @ 2019-05-24 19:39 Kxzh 阅读(353) 评论(0) 推荐(0) 编辑
摘要: #define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR 0 #define OVERFLOW -2 #define INIT_SIZE 20 #define INCREMENT_SIZE 5 typedef int SElemType; typedef int Status; /* * 存储结构 */ typedef struc... 阅读全文
posted @ 2019-05-24 19:22 Kxzh 阅读(154) 评论(0) 推荐(0) 编辑
摘要: #include #include #define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR 0 #define OVERFLOW -2 typedef int ElemType; typedef int Status; /* * 存储结构 */ typedef struct LNode { ElemType dat... 阅读全文
posted @ 2019-05-24 19:18 Kxzh 阅读(256) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 14 下一页