red-black-tree
Red Black Tree implementation in nodejs.Here is the definition of Red Black Tree.
Install
npm install redblacktree
Usage
var RedBlackTree = ; //example 1var tree = //set comparatortree var tom = id: 1name: 'tom'var jack = id: 10name: 'jack'var tim = id: 33name: 'tim' treetreetree //check if element exists in treeconsole //return trueconsole //return false //count nodes in treeconsole //return 3 //delete an element in treetree console //return 2 //example 2var tree = forvar i = 1; i <= 10; i++ tree //get the min value in treeconsole //return 1 //get the max value in treeconsole //return 10 //get the inorder sequenceconsole //return [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]