I am trying to create a algorithm thats similar to the dictionary function found in phones, basically, you type the first letter in, and a suggested word comes out, and as you type in more letters in, the dictionary algorithm, look for the best match based on the current letters avaliable. What type of data strucutre should I use ? I am thinking of using a hashmap and the first letter of the words as the key to the hashmap. Is there a better data structure that I could use.
Question
davemania
I am trying to create a algorithm thats similar to the dictionary function found in phones, basically, you type the first letter in, and a suggested word comes out, and as you type in more letters in, the dictionary algorithm, look for the best match based on the current letters avaliable. What type of data strucutre should I use ? I am thinking of using a hashmap and the first letter of the words as the key to the hashmap. Is there a better data structure that I could use.
Link to comment
Share on other sites
3 answers to this question
Recommended Posts