Re: searching algorithm




"Neil Cerutti" <horpner@xxxxxxxxx> wrote in message
news:slrnf46ph1.1hg.horpner@xxxxxxxxxxxxxxxxxxxxx
| On 2007-05-10, Gigs_ <gigs@xxxxxxxxxxx> wrote:
| > if user type: "abs" program should list all words above in
| > english and in croatian if user type: "absorb" than program
| > should list last 3 words in english and in croatian
|
| A solution that solves the problem with a data structure might be
| a multi-tree.

Specific computer science terms are prefix tree or trie (from reTRIEval).
http://en.wikipedia.org/wiki/Trie
gives an introduction.

| Each node points at a set of following letters, and a set of
| croatian translations, either of which might be empty, making the
| node a leaf.
|
| For the above (abrideged) dictionary, you would generate (use a
| fixed-width "programmers" font so the tree looks good):
|
| a
| |
| b
| |
| s
| / \
| i o
| / / \
| n l r
| / / \ \
| t u v b->(absorbirati, crpisti)
| / | |
| (pelin)<-h t e->(odrije?iti, osloboditi)
| | |
| (pelin)<-e e->(apsolutan, apsolutni kod)
|
| As the user enter letters, you just march down the tree, printing
| all the words held in leaf nodes held in the current node.

tjr
|



.



Relevant Pages

  • Re: searching algorithm
    ... type letters. ... english and in croatian if user type: ...
    (comp.lang.python)
  • Need a help for my book
    ... I would like to present you one cryptograph (kind of alphametics). ... It's Croatian, and I believe world record - three terms with 12 ... letters. ...
    (sci.crypt)
  • Need a help for my book
    ... I would like to present you one cryptograph (kind of alphametics). ... It's Croatian, and I believe world record - three terms with 12 ... letters. ...
    (sci.math)