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
Solved

implementation of Computer Dictionary

Posted on 2004-04-24
3
872 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
why debugging a macro i s difficult 10 38
Problem with MFCApp 78 420
How to get time_t value that is a week old 6 169
C Language combined operators 28 115
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…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

828 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