On Jun 26, 6:45 pm, "Mohammad Moghimi" <[EMAIL PROTECTED]> wrote:
> What kind of search algorithm you've used?

Well, I don't really know ;-)

Basically I have generated datastructure on start of program, where
every node has propertis
<letter, number1, number2> SuccLetters (= all letters containded in
subbranch of current node ordered from hi to lo by number1, where
number1 stands for number of words containing THE letter, number2
stands for number of words containing THE letter exactly on next
position (number of words continuing on THE letter))
bool IsWord (= if this node (which also mean letter-chain, so word) is
contained in word-list, there can be only substrings of words
contained in word-list in tree, because of character of this DS)
iterator NextNode[letter] (= child of current node, which has 'letter'
as next letter)

cripled "pseudo" code:

Find (node n, letter_set s) {
  if ( s[0] in n.SuccLetters )
    find (n[s[0]], s[1..s.length] );
  else
    return;
  if ( n.IsWord )
    WriteLine( n.ToString );
}



So, what better DS choose this probably isn't about algorithm, but of
course, I can be wrong. ;-)

I've written it at bustle, so it's probably even uncorrect, but main
idea is clear, I hope. (Since I'm learning english only for few years,
there is probably lots of odd errors, if something is unclear, pls let
me know, I'll try to rephrase.)

                       -- dingo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to