?
Solved

implementation of Computer Dictionary

Posted on 2004-04-24
3
Medium Priority
?
911 Views
Last Modified: 2010-05-18
Hi,
Now a days i have a task to do related to the implementation of Computer dictionary using any data structures. i am an intermediate programmer and also want to finish it off as quickly as possible, so would u plz tell me which data structure i should use to implement the above said concept. i have studied stacks, queues, linked list, trees. i am also planing to use the File concept. if u can help me in shape of any sample code, that would be even better...

with Regards,

Ahmer.

0
Comment
Question by:ahit
[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
3 Comments
 
LVL 9

Accepted Solution

by:
ankuratvb earned 375 total points
ID: 10907339
It depends to what depth you want to approach the problem.

The simplest would be create word-definition pairs and store in two double dimensional arrays.

Then,according to the word entered,find the corresponding meaning by looking up the corresponding index on the definition array.

If you keep the word-defn pairs sorted on word,you can do binary search to improve search speed.

for e.g.
char word[MAX_ENTRIES][MAX_LENGTH];
char defn[MAX_ENTRIES][MAX_LENGTH];

lets say,you find the word wanted at word[102];
the defn would be defn[102];
Simple.

Store the words and meaning in a file and load them into this array at program startup.
You could also store the number of words as well.
Then you can define your array length dynamincally using malloc().

For another idea using trees,see here:
http://oldlook.experts-exchange.com:8080/Programming/Programming_Languages/C/Q_20684111.html
0
 
LVL 2

Expert Comment

by:anupvijay
ID: 10919743
Another idea would be to use a hash table. Although I myself have not had any experience with them but I hear that
it is quite helpful in store and search kind of applications.

If any one else can shed some more light it might help all of us.

Cheers.
0
 
LVL 2

Expert Comment

by:anupvijay
ID: 10919813
0

Featured Post

Industry Leaders: 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

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.

800 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