Click here to Skip to main content
15,891,372 members
Home / Discussions / C#
   

C#

 
AnswerRe: fast search Pin
Ennis Ray Lynch, Jr.10-Nov-08 4:26
Ennis Ray Lynch, Jr.10-Nov-08 4:26 
AnswerRe: fast search Pin
Wendelius10-Nov-08 6:29
mentorWendelius10-Nov-08 6:29 
AnswerRe: fast search Pin
riced10-Nov-08 7:22
riced10-Nov-08 7:22 
AnswerRe: fast search Pin
Pete O'Hanlon10-Nov-08 11:04
mvePete O'Hanlon10-Nov-08 11:04 
GeneralRe: fast search Pin
jas0n2310-Nov-08 22:23
jas0n2310-Nov-08 22:23 
AnswerRe: fast search Pin
Mark Churchill10-Nov-08 16:01
Mark Churchill10-Nov-08 16:01 
AnswerRe: fast search Pin
N a v a n e e t h10-Nov-08 16:31
N a v a n e e t h10-Nov-08 16:31 
AnswerRe: fast search Pin
Alan Balkany11-Nov-08 4:19
Alan Balkany11-Nov-08 4:19 
A database has a lot of overhead, which you can avoid with your own data structure. I suggest a tree structure where each level takes you one letter farther in the word:

The root will have 26 sons, for the 26 possible first letters. Each of these sons will have up to 26 sons (grandsons of the root) for the (up to) 26 possible second letters, and so on.

1. It saves space because all words sharing a common prefix will use the same path from the root, giving you some compression.

2. It's faster than a database because you don't have to do any time-consuming queries; at each node you have a list of all the possible next characters.

3. When building this tree from your word list, you can increment a counter for each letter added at the current node. This will give you the frequencies for each continuation letter. You can then use these frequencies to predict the most likely continuation.
QuestionReading XML Pin
Planker10-Nov-08 2:56
Planker10-Nov-08 2:56 
AnswerRe: Reading XML Pin
Wendelius10-Nov-08 6:39
mentorWendelius10-Nov-08 6:39 
GeneralRe: Reading XML Pin
Planker10-Nov-08 7:33
Planker10-Nov-08 7:33 
GeneralRe: Reading XML Pin
Wendelius10-Nov-08 7:39
mentorWendelius10-Nov-08 7:39 
GeneralRe: Reading XML Pin
Planker10-Nov-08 8:27
Planker10-Nov-08 8:27 
GeneralRe: Reading XML Pin
Wendelius10-Nov-08 8:41
mentorWendelius10-Nov-08 8:41 
GeneralRe: Reading XML Pin
Planker10-Nov-08 9:06
Planker10-Nov-08 9:06 
GeneralRe: Reading XML Pin
Wendelius10-Nov-08 9:13
mentorWendelius10-Nov-08 9:13 
QuestionLog4Net AsyncAppender Pin
fdbpro10-Nov-08 2:18
fdbpro10-Nov-08 2:18 
AnswerRe: Log4Net AsyncAppender Pin
Simon P Stevens10-Nov-08 2:54
Simon P Stevens10-Nov-08 2:54 
GeneralRe: Log4Net AsyncAppender Pin
fdbpro10-Nov-08 19:22
fdbpro10-Nov-08 19:22 
GeneralRe: Log4Net AsyncAppender Pin
Simon P Stevens10-Nov-08 21:44
Simon P Stevens10-Nov-08 21:44 
AnswerRe: Log4Net AsyncAppender Pin
Dave Kreskowiak10-Nov-08 3:51
mveDave Kreskowiak10-Nov-08 3:51 
GeneralRe: Log4Net AsyncAppender Pin
fdbpro10-Nov-08 19:14
fdbpro10-Nov-08 19:14 
GeneralRe: Log4Net AsyncAppender Pin
Simon P Stevens10-Nov-08 22:07
Simon P Stevens10-Nov-08 22:07 
GeneralRe: Log4Net AsyncAppender Pin
fdbpro10-Nov-08 23:35
fdbpro10-Nov-08 23:35 
Questionexport to bitmap Pin
vinay_K10-Nov-08 2:07
vinay_K10-Nov-08 2:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.