Home > trie_example

trie_example

Trie_example is a project mainly written in JAVASCRIPT and RUBY, based on the MIT license.

Trie Example

This is a dictionary implemented as a trie, inspired by Tyler McMullen's LA RubyConf 2010 talk: http://www.scribd.com/doc/27149829/Alternative-Data-Structures-in-Ruby

There are also naive implementations using Array and Set that are fun for comparing performance and memory footprint.

How to use it:

>> require 'trie_dictionary'
=> true
>> d = Dictionary.new
=> #
>> d.add ("fish")
(irb):7: warning: don't put space before argument parentheses
=> true
>> d.add("fiend")
=> true
>> d.add("foo")
=> true
>> d.find('f')
=> ["fish", "fiend", "foo"]
>> d.find('fi')
=> ["fish", "fiend"]
>> d.find('fo')
=> ["foo"]

Alternate implementation Performance results:

  • http://github.com/RyOnLife/trie_example
  • http://github.com/aihui/ruby_prof_test
  • http://github.com/inkredabull/MyRubyClassAssignments/
    • Data
    • Data generator
    • Perf test implementation
    • Perf test results
Previous:selfmodify.j