Usage
First of all, we need a require:
{BinaryTree} = require './binaryTree'
# example element
data = {
username: "pippo"
id: 223
}
After that, we can use the binaryTree this way:
binaryTree = new BinaryTree "username", false
- arg[0] = field to use for cheching position
- arg[1] = caseSensitive search
binaryTree.insert data
Output tree
console.log binaryTree.getAsArray()