[Gambas-user] gb.data: Trie class

Benoît Minisini gambas at ...1...
Wed Sep 24 01:36:03 CEST 2014


Le 23/09/2014 21:47, Tobias Boege a écrit :
> Hi,
>
> in revision #6506, I added two classes to gb.data: Trie and TriePrefix.
> Together they implement a Patricia Trie[0] a.k.a. Radix tree a.k.a. Prefix
> tree.
>
> Trie is the data container. It works just like a Collection. TriePrefix can
> be used to limit searches to a common prefix. This way you can start doing
> things way into the Trie and have to deal with less nodes.
>
> Since the commit adds lots of new code, I would like people to test it with
> the attached project. I will also attach the expected output in a text file.
> (JFTR: There are no memory errors/leaks with it on my system.)
>
> Also, Benoit: tell me what you think about the interface. I documented
> everything in the source code (c_trie.c).
>
> For the adventurous, I attach a simplistic command line interpreter which
> shows the major deal with tries: the ability to search through a set of
> strings simultaneously and doing fast (!) auto-completion of input among a
> number of strings. (NB: I haven't tested this project thoroughly.)
>
> Regards,
> Tobi
>
> PS: Please take revision #6507 which already corrects a bug.
>
> [0] http://en.wikipedia.org/wiki/Radix_tree
>
>

It's a shame that apparently "trie" is the usual name of that data 
structure, because it's not a true name, and nobody knows how to 
pronounce it (like "tree" or "try"?).

The common "Radix tree" is better imho.

But I'm far from being a tree specialist, so you will tell me.

-- 
Benoît Minisini




More information about the User mailing list