This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: string::find complexity.
- From: Jason Merrill <jason at redhat dot com>
- To: Dhruv Matani <dhruvbird at gmx dot net>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Thu, 10 Jun 2004 11:19:29 -0400
- Subject: Re: string::find complexity.
- References: <1086847470.13398.8.camel@localhost.localdomain>
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