brugnara / binary-tree-coffee-node

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

binary-tree-coffee-node

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()

About

License:Apache License 2.0


Languages

Language:CoffeeScript 100.0%