avl-trees-js is a light package that allows you to perform all the avl tree operations efficiently
Installation
$ npm install avl-trees-js
Importing
// Using Node.js `require()`const avl= ; // Using ES6 imports;
Insertion
avl;
Traversing
you can traverse in: inOrder,postOrder and PreOrder
avl;
e.g
avl;
by default you traverse in order i.e
avl;
Getting Maximum and Minimum
avl
returns the node with the maximum value. To get the value just add getData() to the retrieved node. note: .getData() retrieves the stored value in a node i.e
avl
same applies to min except we use Min() in place of Max()
deleting nodes from the tree
avl
removes the node with the value and rebalances the tree
finding the node with the a given value
avl
returns null incase no node with that value exists
Testing
npm test