[Bug libc/5514] memmem is O(n^2), but should be O(n)

ebb9 at byu dot net sourceware-bugzilla@sourceware.org
Sat Mar 29 16:44:00 GMT 2008


------- Additional Comments From ebb9 at byu dot net  2008-03-29 16:43 -------
Created an attachment (id=2339)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=2339&action=view)
fixed-allocation linear memmem/strstr

2008-03-29  Eric Blake	<ebb9@byu.net>

	Rewrite string searches to O(n) rather than O(n^2).
	* string/str-two-way.h: New file, for linear fixed-allocation
	string searching.
	* string/memmem.c: New implementation.
	* string/strstr.c: New implementation.
	* string/strcasestr.c: New implementation.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
Attachment #2161 is|0                           |1
           obsolete|                            |
Attachment #2162 is|0                           |1
           obsolete|                            |


http://sourceware.org/bugzilla/show_bug.cgi?id=5514

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the Glibc-bugs mailing list