摘要: #源文件 #include "head.h" void task_queue_init(struct task_queue *taskQueue, int size) { taskQueue->size = size; taskQueue->total = taskQueue->head = tas 阅读全文
posted @ 2022-03-07 21:56 代码附体 阅读(54) 评论(0) 推荐(0) 编辑
摘要: #my_popen(), my_pclose()代码 ##my_popen.c #include "head.h" static pid_t *childpid = 0; static int maxsize = 0; FILE *my_popen(const char *cmd, const ch 阅读全文
posted @ 2022-02-25 23:05 代码附体 阅读(242) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <stdlib.h> #include <string.h> #define swap(a, b) ({\ __typeof(a) temp = a;\ a = b, b = temp;\ }) typedef struct Node { do 阅读全文
posted @ 2021-11-01 00:52 代码附体 阅读(96) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_N 26 #define GETCODE(a) (a - 'a') typedef struct Node { char *flag; struct Node 阅读全文
posted @ 2021-10-23 10:39 代码附体 阅读(119) 评论(0) 推荐(0) 编辑
摘要: #字符串匹配算法 #include <stdio.h> #include <string.h> #define TEST(func, s, t) printf("%s: %s->%s = %d\n", #func, s, t, func(s, t)) int next[100]; //暴力匹配算法 阅读全文
posted @ 2021-10-12 23:52 代码附体 阅读(51) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #define MAX_N 26 typedef struct Node { int flag; struct Node *next[MAX_N] 阅读全文
posted @ 2021-10-09 20:22 代码附体 阅读(72) 评论(0) 推荐(0) 编辑
摘要: #Trie,字典树,字符串排序 #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_N 26 typedef struct Node { int flag; struct Node *next[MAX_N]; 阅读全文
posted @ 2021-10-04 19:18 代码附体 阅读(44) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <time.h> #include <stdlib.h> #define NIL (&__NIL) typedef struct Node { struct Node *lchild, *rchild; int color, val; } No 阅读全文
posted @ 2021-09-11 05:17 代码附体 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 题目描述 ​ 所谓一个朋友圈子,不一定其中的人都互相直接认识。 ​ 例如:小张的朋友是小李,小李的朋友是小王,那么他们三个人属于一个朋友圈。 ​ 现在给出一些人的朋友关系,人按照从 1到 n编号在这中间会进行询问某两个人是否属于一个朋友圈,请你编写程序,实现这个过程。 输 入 第一行输入两个整数 n 阅读全文
posted @ 2021-08-15 16:44 代码附体 阅读(32) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <time.h> #include <stdlib.h> #define swap(a, b) ({\ __typeof(a) c = a;\ a = b, b = c;\ }) int down_updata (int *p, int i, 阅读全文
posted @ 2021-08-13 11:57 代码附体 阅读(154) 评论(0) 推荐(0) 编辑