Class: binarySearchTree

binarySearchTree(default) → {Object}

new binarySearchTree(default) → {Object}

Parameters:
Name Type Description
default object default node
Properties
Name Type Description
node any value of intitialized BST leaf
Source:
Returns:
- binary search tree instance
Type
Object

Methods

(inner) createBasicStructure(default)

creates default BST leaf
Parameters:
Name Type Description
default object default BST data
Properties
Name Type Description
left any left part of BST leaf
right any right part of BST leaf
node any value of BST leaf
Source:

(inner) get()

Source:
Returns:
BST structure

(inner) insert(value)

inserts value to a BST
Parameters:
Name Type Default Description
value any null
Source:
Returns:
inserted value

(inner) isLeaf(value)

Parameters:
Name Type Description
value any
Source:
Returns:
if value is a leaf

(inner) lookUp(value, fn)

maps over data and returns founded value's leaf to cb function
Parameters:
Name Type Description
value any the value that needed to be found
fn lookUpCallback
Source:

(inner) search(value)

Parameters:
Name Type Description
value any
Source:
Returns:
wheter BST has value or not