$node = Paranoid::Data::AVLTree::AVLNode->new($key, $val); $key = $node->key; $val = $node->val; $rv = $node->setVal($val); $ref = $node->right; $rv = $node->setRight($node); $ref = $node->left; $rv = $node->setLeft($node); $rv = $node->incrRHeight; $rv = $node->incrLHeight; $rv = $node->addRHeight($n); $rv = $node->addLHeight($n); $rv = $node->decrRHeight; $rv = $node->decrLHeight; $balance = $node->balance; $count = $node->count; $height = $node->height; $height = $node->rHeight; $height = $node->lHeight; $rv = $node->updtHeights; @crefs = $node->children;
$node = Paranoid::Data::AVLTree::AVLNode->new($key, $val);
This method creates a new AVLNode object. Like hashes, the key must be defined, but it cannot be a zero-length string. In those cases, this method will return undef.
$key = $node->key;
This method returns the key for the node.
$val = $node->val;
This method returns the associated value for the node. It can be undef.
$rv = $node->setVal($val);
This method sets the assocated value for the node.
$ref = $node->right;
This method retrieves a reference to the next right-side node in the branch, if any.
$rv = $node->setRight($node);
This method sets/removes the reference to the next right-side node in the branch.
$ref = $node->left;
This method retrieves a reference to the next left-side node in the branch, if any.
$rv = $node->setLeft($node);
This method sets/removes the reference to the next left-side node in the branch.
$rv = $node->incrRHeight;
This method increments the height counter for the ride-side sub-branch.
$rv = $node->incrLHeight;
This method increments the height counter for the left-side sub-branch.
$rv = $node->addRHeight($n);
This method adds the passed value to the height counter for the right-side sub-branch.
$rv = $node->addLHeight($n);
This method adds the passed value to the height counter for the left-side sub-branch.
$rv = $node->decrRHeight;
This method decrements the height counter for the right-side sub-branch.
$rv = $node->decrLHeight;
This method decrements the height counter for the left-side sub-branch.
$balance = $node->balance;
This returns the node balance, which is a relative indidcator of the disparity in heights of the right & left sub-branches. A negative number denotes a longer left-side branch, zero means equal sub-branch heights, and a positive integer denotes a longer right-side branch.
$count = $node->count;
This method returns the count of nodes, including all nodes in linked sub-branches.
$height = $node->height;
This method returns the longest height of the node and any attached sub-branches.
$height = $node->rHeight;
This method returns the height of the right-side sub-branch, or zero if there is no linked branch.
$height = $node->lHeight;
This method returns the height of the left-side sub-branch, or zero if there is no linked branch.
$rv = $node->updtHeights;
This method performs a brute force recalculation of all attached sub-branches.
@crefs = $node->children;
This returns references to the next nodes in any attadhed sub-branches.
a) the GNU General Public License <https://www.gnu.org/licenses/gpl-1.0.html> as published by the Free Software Foundation <http://www.fsf.org/>; either version 1 <https://www.gnu.org/licenses/gpl-1.0.html>, or any later version <https://www.gnu.org/licenses/license-list.html#GNUGPL>, or b) the Artistic License 2.0 <https://opensource.org/licenses/Artistic-2.0>,
subject to the following additional term: No trademark rights to ``Paranoid'' have been or are conveyed under any of the above licenses. However, ``Paranoid'' may be used fairly to describe this unmodified software, in good faith, but not as a trademark.
(c) 2005 - 2020, Arthur Corliss (corliss@digitalmages.com) (tm) 2008 - 2020, Paranoid Inc. (www.paranoid.com)
Copyright © 1997 - 2019, Arthur Corliss, all rights reserved.