数据结构串的BF算法模式匹配
发布时间
阅读量:
阅读量
目录
字符串
定义
字符串的创建
字符串的比较
模式匹配
BF算法
概述
BF算法代码
性能分析
串
定义
字符串是指由若干个字符按特定顺序排列而构成的有限长度的序列,其字符数量可以为零或多个。

串的创建方法
#define MaxSize 100
typedef struct {
char data[MaxSize];
int Length;
}SqString;
int StrAssign(SqString &s,char cstr[])
{
s.Length = 0;
while ((s.Length < MaxSize) && (cstr[s.Length] != '\0'))
{
s.data[s.Length] = cstr[s.Length];
s.Length++;
}
全部评论 (0)
还没有任何评论哟~
