×

Loading...

它的意思是要查找sequence from i to j 中,(查找时实际上是i to j-1,)的subsequence p to q(查找时是p to q-1) , 如果找到了子序列数,那么返回找到的位置,反之返回j. 这是一个template class. 以下代码仅供参考.

guest (fang)
Src1 search (Scr1 i, Scr1 j, Scr2 p, Scr2q);
{
Src1 tSrc1, mSrc1=i;
Src2 Src2=p;
while(mSrc1!=j){
tSrc1=mSrc1;
tSrc2=p;
while((*tSrc1==*tScr2)&&(tSrc2!=q)&&(tSrc1=q))
{++tSrc1;++tSrc2;}
if (tSrc==q)
return mSrc1;
mSrc1++;
}
return j;
}
}
}
(#42145@0)
2001-4-8 -04:00
This post has been archived. It cannot be replied.
Page address has been copied. To share, click to copy page address.
Share Online by QR Code

Back To Topic: a c++ test for c++ friends

Back To Forum: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论