Trie search algorithm

Discussion in 'Ruby' started by Justin To, Jun 13, 2008.

  1. Justin To

    Justin To Guest

    I'm lost--can't figure out the algorithm to output a trie.

    class Trie
    @value
    @children = [] # array of tries
    @number_exists # bool
    end

    0 # Root = nil
    /
    1 => number_exists = true(#1)
    /
    1 => number_exists = true(#11)
    / => 1 => true(#111)
    / => 2 => true(#1112)
    / => 2 => true(#112)
    / => 5 => true(#1125)
    0 => number_exists = true(#110)

    Any help is much appreciated, thanks!

    Justin
    --
    Posted via http://www.ruby-forum.com/.
    Justin To, Jun 13, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joseph

    compressed suffix trie

    Joseph, Sep 22, 2004, in forum: Java
    Replies:
    1
    Views:
    511
    =?ISO-8859-1?Q?Daniel_Sj=F6blom?=
    Sep 22, 2004
  2. Joseph

    compressed suffix trie

    Joseph, Sep 22, 2004, in forum: C++
    Replies:
    3
    Views:
    1,789
    Victor Bazarov
    Sep 22, 2004
  3. Miki Tebeka

    [ANN] Trie for Python

    Miki Tebeka, Oct 1, 2003, in forum: Python
    Replies:
    0
    Views:
    411
    Miki Tebeka
    Oct 1, 2003
  4. chuck
    Replies:
    8
    Views:
    1,021
    chuck
    Oct 1, 2007
  5. markspace

    Patricia trie vs binary search.

    markspace, May 25, 2012, in forum: Java
    Replies:
    32
    Views:
    870
Loading...

Share This Page