AVL Tree ADT for browser and nodejs
Download the production version or the development version.
$ npm install --save avl-tree-adt
$ bower install --save avl-tree-adt
var AVLTree = require('avl-tree-adt');
var avlTree = new AVLTree();
<script type="text/javascript" src="https://raw.githubusercontent.com/pasangsherpa/avl-tree-adt/master/dist/avl-tree-adt.min.js"></script>
<script type="text/javascript">
var avlTree = new AVLTree();
</script>
Create an empty tree with.
Add an element to tree.
Type: object
the element to be added to the tree.
Remove an element from the tree and return the element.
Type: object
the element to be removed from the tree.
Returns the root of the tree.
Type: object
the root of the tree
Find an element from the tree and return the element.
Type: object
the specified element.
Returns true if this tree contains no elements.
Type: boolean
whether or not the tree is empty.
Returns the number of elements in the tree.
Type: int
the number of element in the tree.