>>What kind of searches will be performed? E.g.
>>Only prefix matches or general substring matches?
I thought you meant a specific word from a "general substring"
well,I want to find just a specific word not all the words which have a specific prefix,I don' know which one is better?
(for prefixes I think a DAWG is better because it would have less nodes.how I can implement DAWG?)
thanks.
Both DAWG and B-Tree are general structures. If you want to determine if a word is in a container, then you could throw all the words in a hashtable. Depends what how the words are going to be searched, which seems unclear at the moment. Both hashtable and trie offer O(1) lookup. Tries have the added advantage of prefix matching in O(1) time. B-Tree would be log(n). DAWG is just a general name, directed acyclic weighted graph.Not sure how you plan on using DAWG to find words.