mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2025-12-08 19:06:00 +00:00
20 lines
329 B
JavaScript
20 lines
329 B
JavaScript
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();
|
|
}
|
|
}
|