摘要:
#源文件 #include "head.h" void task_queue_init(struct task_queue *taskQueue, int size) { taskQueue->size = size; taskQueue->total = taskQueue->head = tas 阅读全文
摘要:
#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 阅读全文
摘要:
#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 阅读全文
摘要:
#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 阅读全文
摘要:
#字符串匹配算法 #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]; //暴力匹配算法 阅读全文
摘要:
#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] 阅读全文
摘要:
#Trie,字典树,字符串排序 #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_N 26 typedef struct Node { int flag; struct Node *next[MAX_N]; 阅读全文
摘要:
#include <stdio.h> #include <time.h> #include <stdlib.h> #define NIL (&__NIL) typedef struct Node { struct Node *lchild, *rchild; int color, val; } No 阅读全文
摘要:
题目描述 所谓一个朋友圈子,不一定其中的人都互相直接认识。 例如:小张的朋友是小李,小李的朋友是小王,那么他们三个人属于一个朋友圈。 现在给出一些人的朋友关系,人按照从 1到 n编号在这中间会进行询问某两个人是否属于一个朋友圈,请你编写程序,实现这个过程。 输 入 第一行输入两个整数 n 阅读全文
摘要:
#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, 阅读全文