摘要: #include <stdio.h> #include <time.h> #include <stdlib.h> #define swape(a, b) ({\ __typeof(a) temp = a;\ a = b; b = temp;\ }) typedef struct priority_q 阅读全文
posted @ 2021-08-07 00:28 代码附体 阅读(32) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct Node { char *data; struct Node *next; } Node; typedef struct hash_table { No 阅读全文
posted @ 2021-07-29 10:43 代码附体 阅读(35) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #define P(func, ar, m, x) ({\ printf("%s => %d == %d\n", #func, x, func(ar, m, x));\ }) int binary_search(int *ar, int m, int x) { 阅读全文
posted @ 2021-07-15 16:34 代码附体 阅读(39) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <time.h> #include <string.h> #include <stdlib.h> #define swap(a, b) ({\ __typeof(a) __temp = a;\ a = b; b = __temp;\ }) #d 阅读全文
posted @ 2021-07-13 16:21 代码附体 阅读(44) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <string.h> #include <time.h> #include <stdlib.h> #define swape(a, b) ({\ __typeof (a) temp;\ temp = a;\ a = b;\ b = temp;\ 阅读全文
posted @ 2021-07-13 16:18 代码附体 阅读(43) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <stdlib.h> #include <time.h> #define max(a, b) ((a) > (b) ? (a) : (b)) typedef struct Node { int key, height; struct Node 阅读全文
posted @ 2021-05-27 00:23 代码附体 阅读(45) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <time.h> #define MAX 100 void cha_ru (int *ar) { int i, j, c, b; for (i = 1; i < MAX; ++i) { for (j = 0; j < i; ++j) if (a 阅读全文
posted @ 2020-12-18 11:10 代码附体 阅读(73) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <stdlib.h> #include <time.h> #define MAX 500 void sort(int *); int fond(int *, int, int, int); int main () { int arr[MAX], 阅读全文
posted @ 2020-12-11 10:51 代码附体 阅读(78) 评论(0) 推荐(0) 编辑
摘要: #邻接矩阵 #include <stdio.h> #include <string.h> #define MAX_N 500 typedef struct Graph { int mat[MAX_N][MAX_N]; int n; }Graph; void init(Graph *g, int le 阅读全文
posted @ 2020-11-27 03:01 代码附体 阅读(243) 评论(1) 推荐(2) 编辑
摘要: #include <stdio.h>#include <stdlib.h>#include <time.h>typedef struct Node { int data; struct Node *lchild, *rchild;} Node;typedef struct Tree { Node * 阅读全文
posted @ 2020-11-20 02:57 代码附体 阅读(302) 评论(2) 推荐(3) 编辑