11 Mar 2017 06:03:27 UTC
- Distribution: Tree-Create-DepthFirst
- Module version: 0.02
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (531 / 0 / 0)
- KwaliteeBus factor: 0
- 93.10% Coverage
- License: perl_5
- Perl: v5.6.0
- Download (10.18KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
use Tree::Create::DepthFirst; my $tree_creator = Tree::Create::DepthFirst->new(); $tree_creator -> addNode(0, 'child 1'); $tree_creator -> addNode(0, 'child 2'); $tree_creator -> addNode(1, 'grand chhild 1'); $tree_creator -> addNode(1, 'grand chhild 2'); $tree_creator -> addNode(2, 'grand-grand chhild 2'); my $tree_simple = $tree_creator->getTree();
Creates the tree creator.
my $tree_creator = Tree::Create::DepthFirst->new()
From now on, you will want to call
until the tree is finished. Then you get the created tree with
my $tree_simple = $tree_simple->getTree();
Add tree nodes and leaves in the same order as a depth first traversal would traverse the tree.
There are two restrictions on $depth: a) it must be greater or equal to 0. b) It must not be greater than the last added node's $depth+1.
After building, getTree() returns the created tree (as a Tree::Simple) object.
$tree_simple = $tree_creator->getTree();
<rene.nyffenegger at adp-gmbh.ch>
According to the
LICENSEfile that comes with the package.
The source code is in this Github repository
Module Install Instructions
To install Tree::Create::DepthFirst, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Tree::Create::DepthFirst
For more information on module installation, please visit the detailed CPAN module installation guide.
|s||Focus search bar|
|?||Bring up this help dialog|
|g p||Go to pull requests|
|g i||go to github issues (only if github is preferred repository)|
|g a||Go to author|
|g c||Go to changes|
|g i||Go to issues|
|g d||Go to dist|
|g r||Go to repository/SCM|
|g s||Go to source|
|g b||Go to file browse|