Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Perl

Idiom #159 Trie

Define a Trie data structure, where entries have an associated value.
(Not all nodes are entries)

use Data::Trie qw();
my $trie = Data::Trie->new;
struct Trie
{
    Rune c;
    Trie*[Rune] children;
    bool isEntry;
    bool value;
}

New implementation...
< >
programming-idioms.org