binary search tree & avl tree (self balancing tree) implementation in javascript
Package Exports
@datastructures-js/binary-search-tree
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@datastructures-js/binary-search-tree) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@datastructures-js/binary-search-tree
Binary Search Tree & AVL Tree (Self Balancing Tree) implementation in javascript.
// BinarySearchTree<T extends number|string, U = undefined>const bst =newBinarySearchTree<number, string>();
// AvlTree<T extends number|string, U = undefined>const bst =newAvlTree<number,{id: string,count: number }>();
.insert(key[, value])
inserts a node with key/value into the tree and returns the inserted node. Inserting an node with existing key, will update the existing node's value with the new one.