a c++ test for c++ friends

zlx (steven)
Implement the following generic Standard Library function defined in <algo>:
template <class Src1, class Src2>
Src1 search (Scr1 i, Src1 j, Src2 p, Src2 q);
// Searches the sequence i…(j-1) for a subsequence that equals
// the sequence p…(q-1). If found, position k where it begins
// is returned; otherwise, j is returned.
// Invariant: no elements are changed.

I cannot understand the meaning. How can I find a Src2 sequence in a Src1 sequence? How to access to next Src1 from (Src1 i) to (Src1 j).
Who could give the Implement? Thanks in advance!
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技术讨论