Use a trie, the memory needed will be less than having a list of
strings and it will be faster than hashTable (array implementation of
trie). Check Trie in Wikipedia. If the datastructure is going to be
static, then using a Directed acyclic finite automata (dafsa) may be
even better.

On Sep 30, 9:45 pm, amit <[email protected]> wrote:
> Design a hash table to store phone #s. Your job is to write a hash
> function that has a parameter username, and generate a key. Username
> is unique, length 5 and can be A-Z, 0-9, space. Write a hash function
> that generate keys without collisions and use minimum memory.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to