会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
代码附体
代码皆为linux环境
首页
新随笔
联系
订阅
管理
随笔 - 20
文章 - 0
评论 - 3
阅读 -
2147
2022年3月7日
线程池
摘要: #源文件 #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 代码附体
阅读(62)
评论(0)
推荐(0)
2022年2月25日
实现linux 中c 函数popen( ),pclose( ); 进程通信、匿名管道
摘要: #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 代码附体
阅读(264)
评论(0)
推荐(0)
2021年11月1日
哈夫曼编码, 哈夫曼树
摘要: #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 代码附体
阅读(104)
评论(0)
推荐(0)
2021年10月23日
AC自动机, 多模匹配, 字符串匹配
摘要: #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 代码附体
阅读(130)
评论(0)
推荐(0)
2021年10月12日
暴力匹配,kmp,sunday, shift-and, shift-or, 字符串匹配算法,单模匹配, 多模匹配
摘要: #字符串匹配算法 #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 代码附体
阅读(62)
评论(0)
推荐(0)
2021年10月9日
双数组字典树
摘要: #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 代码附体
阅读(125)
评论(0)
推荐(0)
2021年10月4日
字典树, 字符串排序,Trie
摘要: #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 代码附体
阅读(48)
评论(0)
推荐(0)
2021年9月11日
红黑树
摘要: #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 代码附体
阅读(109)
评论(0)
推荐(0)
2021年8月15日
quick_fond算法, quick_union算法, weighted_quick_union算法, weighted_quick_union_with_path_comperession算法, 森林,并查集,朋友圈问题
摘要: 题目描述 所谓一个朋友圈子,不一定其中的人都互相直接认识。 例如:小张的朋友是小李,小李的朋友是小王,那么他们三个人属于一个朋友圈。 现在给出一些人的朋友关系,人按照从 1到 n编号在这中间会进行询问某两个人是否属于一个朋友圈,请你编写程序,实现这个过程。 输 入 第一行输入两个整数 n
阅读全文
posted @ 2021-08-15 16:44 代码附体
阅读(43)
评论(0)
推荐(0)
2021年8月13日
线性建堆, 堆,堆排序,
摘要: #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 代码附体
阅读(179)
评论(0)
推荐(0)
下一页
公告
昵称:
代码附体
园龄:
5年7个月
粉丝:
5
关注:
7
点击右上角即可分享