Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Trie search algorithm

Reply
Thread Tools

Trie search algorithm

 
 
Justin To
Guest
Posts: n/a
 
      06-13-2008
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/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Patricia trie vs binary search. markspace Java 32 05-30-2012 01:25 AM
help with my recursive trie search chuck Java 8 10-01-2007 10:44 PM
compressed suffix trie Joseph Java 1 09-22-2004 07:23 PM
compressed suffix trie Joseph C++ 3 09-22-2004 06:02 PM
[ANN] Trie for Python Miki Tebeka Python 0 10-01-2003 03:36 PM



Advertisments