![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
文章平均质量分 67
yangjianjian151
这个作者很懒,什么都没留下…
展开
-
枚举法求迷宫
#include #include #define OK 1 #define ERROR 0 #define STACK_INIT_SIZE 100 typedef int Status; typedef struct { int x, y; } PosType; typedef struct { int ord; PosType seat; int d原创 2012-11-29 21:49:50 · 178 阅读 · 0 评论 -
KMP算法
#include #include #include #define MAXN 255 typedef char SString[MAXN + 1]; int next[1 << 8]; void get_nextval(SString t) { int i = 1, j = 0; next [1] = 0; while (i < t[0]) {原创 2012-11-29 21:56:06 · 139 阅读 · 0 评论 -
C语言 链表
#include #include #define OK 1 #define ERROR 0 typedef int Status; typedef int ElemType; typedef struct List { ElemType Data; struct List *next; } LNode, *LinkList; /* 求链表的长度 */ Status L原创 2012-11-29 21:27:17 · 156 阅读 · 0 评论 -
KMP Python
next = [] s = 'aaaaab' t = 'aaaab' def getnext(): next.append(-1) i = 0; j = -1 while i < len(t) - 1: if j == -1 or t[i] == t[j]: i += 1; j += 1 if t[i] ==原创 2012-12-06 19:22:38 · 179 阅读 · 0 评论