Solved

implementation of Computer Dictionary

Posted on 2004-04-24
3
865 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
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
ankuratvb earned 125 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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Pointer in one class to member in another 6 121
Read file descriptor 3 in C 14 107
C dll call freezes 5 103
Console based application in Linux 1 90
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.

831 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