Click to See Complete Forum and Search --> : Creating a Trie


nisaa15
November 10th, 2005, 04:56 AM
Hey,

How would I go about developing a trie to store a small dictionary (about 10 words to begin with) of words, that can later be searched for string matching. How would the words be stored? (I mean would I need to store them in an array or would I be able to read each separate word from a text file to create the trie?)

Cheers for any help

ishiwaka
November 11th, 2005, 03:30 AM
Hi, you can store it in a file or in a sql table,

nisaa15
November 11th, 2005, 04:45 AM
What about if its being done in java. What sort of classes and methods would be needed?

Shassi
November 11th, 2005, 10:57 AM
Hi, you can store it in a file or in a sql table,
No I suggest excel files, because it can sort and subclass, something old and out of date can be easily maintained and modified for future use!

Shassi
November 11th, 2005, 11:07 AM
What about if its being done in java. What sort of classes and methods would be needed?
I also think you were asking about how to create a database to store your dictionary.
By the way, what makes you think of classes and methods that should be the first to take into consideration ?

Programming language is not the prerequisite to solving your problem here, which you would have known that when your first post is in Algorithm.

Could you please now answer my question ?

RoboTact
November 11th, 2005, 07:53 PM
(about 10 words to begin with)Using algorithms is justified by implied overhead. If algorithms are not already somewhere in standard library and using them in primitive cases don't create net overhead, it's about OK. But if it's not the case and it's known that there ever would be only 10 words, you don't need one. Maximum precaution is creation of simple interface of algorithm and implementing some brute-force approach, reserving the point for possible future algorithm implementation.

Please don't cross-post (http://www.codeguru.com/forum/showthread.php?t=364176).

nisaa15
November 13th, 2005, 08:13 PM
I also think you were asking about how to create a database to store your dictionary.

I don't need a database I have a list of word, about ten words (to start with, I will add more once I have developed a basic trie).

I thought it would be better for me to specify a language so that one may understand what kind of thing I am trying to do a little better. Besides most people that know of algorithms and data structures know of some programming languages which they sometimes base their thoughts from.

Hope that answers ur question mate.