Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to implement an oxford english dictionary?

Posted on 2010-09-06
4
Medium Priority
?
1,260 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
Simple Linear Regression
Starting up a Project

604 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