๐Ÿ“ฆ juise / trie

The Trie (Prefix Tree / Radix Tree or maybe Suffix Tree)

โ˜… 2 stars โ‘‚ 0 forks ๐Ÿ‘ 2 watching โš–๏ธ Apache License 2.0
๐Ÿ“ฅ Clone https://github.com/juise/trie.git
HTTPS git clone https://github.com/juise/trie.git
SSH git clone git@github.com:juise/trie.git
CLI gh repo clone juise/trie
Alexander Petrovsky Alexander Petrovsky Fix bug โ€” wrong prefix search ade951f 9 years ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ src
๐Ÿ“ test
๐Ÿ“„ .gitignore
๐Ÿ“„ .travis.yml
๐Ÿ“„ LICENSE
๐Ÿ“„ Makefile
๐Ÿ“„ README.md
๐Ÿ“„ rebar.config
๐Ÿ“„ rebar.lock
๐Ÿ“„ rebar3
๐Ÿ“„ README.md

trie ====

Build Status

The Trie (Prefix Tree / Radix Tree) โ€” https://en.wikipedia.org/wiki/Trie

Build


$ make

Tests


$ make test

Usage


$ make run 1> application:load(trie). ok 2> Tree = lists:foldl(fun(X, Acc) -> trie:add_leaf(X, Acc) end, trie:new(), ["help", "hello", "helloween"]). {root, [ {"hel", [ {"lo", [ {leaf, []}, {"ween", [ {leaf, []} ]} ]}, {"p", [ {leaf,[]} ]} ]} ]} 3> trie:search_leaf("helloween", Tree). "helloween" 4> trie:searchprefixleaf("helloween", Tree). "hello"