Add binary search tree.

This commit is contained in:
Oleksii Trekhleb
2018-04-02 17:50:56 +03:00
parent 00e40a0eca
commit d6be33842c
8 changed files with 184 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
import BinarySearchTreeNode from './BinarySearchTreeNode';
export default class BinarySearchTree {
constructor() {
this.root = new BinarySearchTreeNode();
}
insert(value) {
this.root.insert(value);
}
contains(value) {
return this.root.contains(value);
}
toString() {
this.root.toString();
}
}