Skip to content

ssp5zone/javascript-avl-tree-bi-directional

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

JavaScript Bi-Directional AVL Tree

A simple javascript Bi-directional AVL Tree that uses progressive (non-return) calls to update its node.

USAGE

var tree = new AVLTree(); // Initialize
tree.add(value);          // Add a new node
tree.remove(value);       // Remove an existing node
tree.getRoot();           // Get Root element
tree.print();             // Print the tree as a text-pyramid in console
tree.min();               // Find smallest node
tree.max();               // Find largest node
tree.find(value);         // Find node with given value
tree.destroy();           // Clears the root

Note: To maintain the spacing while using tree.print(), any value greater than 2 digits/characters will be converted to a legend labelled as 'a' to 'z'. The label and key would be printed seperatly.

Licence

Licenced under GNU GENERAL PUBLIC LICENSE v3.0. It is free to copy, use and distribute.

About

A bi-directional JavaScript AVL tree based on progressive (non-return) algorithm of BST

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published