From: Dom Lachowicz (domlachowicz@yahoo.com)
Date: Wed Sep 24 2003 - 13:09:01 EDT
--- Raphael Finkel <raphael@cs.uky.edu> wrote:
> It sounds like hashing is just the thing you want.
> Every string gets
> hashed (can be fast), placed in a hash table
> (resolving collisions
> somehow; I prefer external chaining). Checking for
> equality and
> insertion in the table each requires about O(1) time
> (the time depends
> on the string length, whether your table is big
> enough, and how unlucky
> you are about collisions). It scales linearly with
> document length, not
> quadratically. It's a well-known technique.
Again - these strings are already in a hash. I've
tried speeding things up by plunking them out of a
hash table. In reality, the speed of the hashing
algorithm + returning the associated piece of data is
roughly equal to the speed of several strcmps.
People, please stop stabbing wildly and blindly at the
problem. Look at the code in question. Then post
things to the ML.
Dom
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
This archive was generated by hypermail 2.1.4 : Wed Sep 24 2003 - 13:23:42 EDT