Constructor
new BinarySearchTree()
The tree has to start with a single parent, the "root" of the tree.
- Source:
Methods
add(value)
Add a new item to the tree. Start traversal through current nodes, bouncing between left and right nodes
depending on them being less than or greater than the value. Add the value if a node is 'null'.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
- Source:
contains(value) → {boolean}
Search through the tree it it contains the value.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
* | Value mathing to node in the tree |
- Source:
Returns:
- Type
- boolean

