Solved

How to implement an oxford english dictionary?

Posted on 2010-09-06
4
1,253 Views
Last Modified: 2012-06-21
Which data structure would be the most efficient to implement this - HashTable/Tree?
0
Comment
Question by:malakheti
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 12

Expert Comment

by:w00te
ID: 33613617
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
0
 
LVL 12

Accepted Solution

by:
w00te earned 500 total points
ID: 33613640
Oh, and by the way- in case you start looking for the multiple values per dictionary key issue, you can handle it pretty easily with:
Dictionary<String,List<Customer>>
This thread covers various options for that:
http://stackoverflow.com/questions/569903/multi-value-dictionary 
0
 
LVL 3

Expert Comment

by:firozmusthafa
ID: 33614223
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!
0
 

Author Closing Comment

by:malakheti
ID: 33624766
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.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question