If there are lots of strings there (eg. >100), hash would be quite good (O(1) when there is no collisions) ; there is some strorage and hash generating overhead, though.
But for huge amount of strings, I would use tries to store the data (try googling for trie).
Last edited by ToniT; 11-16-2004 at 02:17 AM.
|