implementar la clase BinarySearchTree, definiendo los siguientes métodos recursivos: - size: retorna la cantidad total de nodos del árbol - insert: agrega un nodo en el lugar correspondiente - contains: retorna true o false luego de evaluar si cierto valor existe dentro del árbol - depthFirstForEach: recorre el árbol siguiendo el orden depth first (DFS) en cualquiera de sus variantes, según se indique por parámetro ("post-order", "pre-order", o "in-order"). Nota: si no se provee ningún parámetro, hará el recorrido "in-order" por defecto. - breadthFirstForEach: recorre el árbol siguiendo el orden breadth first (BFS) El ábrol utilizado para hacer los tests se encuentra representado en la imagen bst.png dentro del directorio homework.
class BinarySearchTree { constructor(value) { this.value = value; this.left = null; this.right = null; } insert(value) { let newNode = new BinarySearchTree(value); if (value < this.value) { if (!this.left) { this.left = newNode; } else { this.left.insert(value); } } else if (value > this.value) { if (!this.right) { this.right = newNode; } else { this.right.insert(value); } } } contains(value) { if (this.value === value) return true; if (value < this.value) { if (!this.left) return false; else return this.left.contains(value); } else if (value > this.value) { if (!this.right) return false; else return this.right.cont