This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: string::find complexity.


On 10 Jun 2004 11:35:51 +0530, Dhruv Matani <dhruvbird@gmx.net> wrote:

> I wanted to know why the string::find(string pos, n) function is
> implemented as O(n^2), instead of the KMP algorithm which is much faster?

Presumably because I wasn't aware of the KMP algorithm when I wrote the
first implementation of the string class, and nobody has submitted a patch
to improve it.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]