数据结构与算法课后习题解答
int curlen; // curlen表示终端结点在向量中的位置
}seqstring;
typedef struct node
{char data;
struct node *next ;
}linkstring;
4.2 int index(string s,t)
//s,t是字符串,本算法求子串t在主串ss串中包含t串,返回其
//第一个字符在s中的位置,否则返回0
{m=length(s); n=length(t); i=1;
while(i<=m-n+1)
else
return(i);//模式匹配成功
else return(0);//s串中无子串t
}//算法index结束
4.3 设A=” ”, B=”mule”, C=”old”, D=”my” 则:
(a) (a) strcat(A,B)=”mule”
(b) (b) strcat(B,A)=”mule”
搜索“diyifanwen.net”或“第一范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,第一范文网,提供最新工程科技数据结构与算法课后习题解答(21)全文阅读和word下载服务。
相关推荐: