-
-
09 Aug 2004 19:39:23 UTC
- Distribution: data-trie
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (1)
- Testers (443 / 0 / 0)
- Kwalitee
Bus factor: 0- % Coverage
- License: unknown
- Activity
24 month- Tools
- Download (2.3KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- unknown
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Data::Trie - An implementation of a letter trie
SYNOPSIS
use Data::Trie; $t = Data::Trie->new; $t->add('orange', 'kind of fruit'); ($result, $data) = $t->lookup->('orange'); $t->remove('orange'); $t->getAll;
DESCRIPTION
This module implements a letter trie data structure. This is a linked set of nodes representing a set of words. Starting from the root, each letter of an included word is a daughter node of the trie. Hence, if a word is in the trie, there will be a path from root to leaf for that word. If a word is not in the trie, there will be no such path.
This structure allows for a relatively compact representation of a set of words. This particular implementation allows each word to be stored alone or with some associated data item.
Note that the
remove()
method does not prune nodes and thus aTrie
can only grow in size.COMPARE
This implementation differs from Tree::Trie in that
lookup()
checks for a match, rather than checking for whether the current string is a prefix.VERSION
0.01
AUTHOR
Michael Hammond, hammond@u.arizona.edu
Module Install Instructions
To install Data::Trie, copy and paste the appropriate command in to your terminal.
cpanm Data::Trie
perl -MCPAN -e shell install Data::Trie
For more information on module installation, please visit the detailed CPAN module installation guide.