1957

无聊蛋疼的1957写的低端博客
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2013年5月28日

摘要: 虽然可能不太实用,但是思想去很厉害。先处理模式串P,得到一个表B,记录字母表中每个字母位的掩码bm....b1,如果P_j=c 那么掩码B[c]的第j位位置为1,否则为0。匹配过程就是对D的更新D = ((D << 1) | 1) & B[T[i]]#include <string.h>#include <stdio.h>const int maxn = 1000;int shift_and(char* T , char* P){ unsigned int B[256] = {0}; unsigned int D = 0; for(int i = 0 阅读全文

posted @ 2013-05-28 13:59 1957 阅读(320) 评论(0) 推荐(0)