http://www.perlmonks.org?node_id=734538


in reply to memory-efficient hash kind for incremental sort

You want a 'trie' datastructure - a well known datastructure from the literature. The Perl regexp engine uses one (in C).

I'm not aware of a canned CPAN solution, but tries are a pretty simple datastructure.

  • Comment on Re: memory-efficient hash kind for incremental sort

Replies are listed 'Best First'.
Re^2: memory-efficient hash kind for incremental sort
by grinder (Bishop) on Jan 07, 2009 at 11:56 UTC

    A good CPAN solution that I've played with in the past is Tree::Trie. I would discard Data::Trie as it doesn't do prefix lookups.

    There's also Text::Trie written by the illustrious ILYAZ. While I find it's good for seriously complex problems, it doesn't make the simple things easy. Lots of make-work code to set up all the necessary callbacks.

    • another intruder with the mooring in the heart of the Perl