Link to home
Start Free TrialLog in
Avatar of malakheti
malakheti

asked on

How to implement an oxford english dictionary?

Which data structure would be the most efficient to implement this - HashTable/Tree?
Avatar of w00te
w00te
Flag of United States of America image

I'm unsure as to why you wouldn't just use a C# dictiaonry object.  It has an internal hash table representation which is extremely efficient (kinda the point).  Was there a reason you were looking to implement it yourself? (and as you can tell, my answer is definitely hash table over tree :) ).
From MSDN: "The Dictionary<(Of <(TKey, TValue>)>) generic class provides a mapping from a set of keys to a set of values. Each addition to the dictionary consists of a value and its associated key. Retrieving a value by using its key is very fast, close to O(1), because the Dictionary<(Of <(TKey, TValue>)>) class is implemented as a hash table."
http://msdn.microsoft.com/en-us/library/xfhwa508.aspx
-w00te
ASKER CERTIFIED SOLUTION
Avatar of w00te
w00te
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you could use any of the basic datastructures ranging from multiilevel hashes to dynamic hashes, refer a good datastructures text book or just google it!
Avatar of malakheti
malakheti

ASKER

This is exactly what I wanted to know about. I knew hashtable is most efficient for lookup, but was not sure about the multiple values.