I am preparing for my interview and came across this question:
Consider that i have 1000,000 words and i want to create a dictionary . The data structure i can use is Map or B+ trees .
But on what criteria should i write my hashcode(), so that the retrieval can be fast.
would welcome everybody views…
I would use neither and store the dictionary as a Patricia trie instead.
It also uses less memory since you’re not storing all the common prefixes of all strings separately.