Ron Savage > Tree-Binary-1.06 > Tree::Binary::Search::Node

Download:
Tree-Binary-1.06.tgz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 1.06   Source  

NAME ^

Tree::Binary::Search::Node - A node for a Tree::Binary::Search tree

SYNOPSIS ^

  use Tree::Binary::Search::Node;

DESCRIPTION ^

This is a subclass of Tree::Binary and is mostly used by Tree::Binary::Search.

METHODS ^

new ($node_key, $node_value)

The constructor takes a $node_key and a $node_value. The key is used by Tree::Binary::Search to order the nodes in the tree. Both arguments are required, and exception is thrown if they are not present.

getNodeKey

Returns the node key as set in the constructor. Node keys are write-once-read-only values, if you could change the node key, it would mess up the entire search tree.

makeRoot

This is used by Tree::Binary::Search when it need to re-root a tree due to a deletion.

clone

Makes sure that the node key is cloned as well.

TO DO ^

Reference node keys

Right now, there is nothing preventing you from using anything you want as a node key as long as you create the proper comparison function in Tree::Binary::Search. I would like to test this more, and possibly write some code to faciliate it.

BUGS ^

None that I am aware of. Of course, if you find a bug, let me know, and I will be sure to fix it.

CODE COVERAGE ^

See the CODE COVERAGE section of Tree::Binary for details.

AUTHOR ^

stevan little, <stevan@iinteractive.com>

COPYRIGHT AND LICENSE ^

Copyright 2004, 2005 by Infinity Interactive, Inc.

http://www.iinteractive.com

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: