07 2011 档案

摘要:#include "stdio.h" #include "string.h" #include "stdlib.h" struct dictree { struct dictree *child[26]; int n; }; //结点结构,有26个子节点struct dictree *root; void insert (char *source) { int len,i,j; struct dictree *current,*newnode; len=strlen(source); if(len==0) return; curren 阅读全文
posted @ 2011-07-19 08:52 bjtulq
摘要:最近在看字符串匹配算法,参考了文章:http://www.cppblog.com/mythit/archive/2009/04/21/80633.html以下我给出了AC算法的C语言实现,题目是http://acm.hdu.edu.cn/showproblem.php?pid=2222/* * ac.c--多模式匹配算法 * * Created on: Jul 14, 2011 * Author: root */#include <stdio.h>#include <malloc.h>#include <stdlib.h>#include <strin 阅读全文
posted @ 2011-07-15 15:43 bjtulq 阅读(1991) 评论(0) 推荐(0)