BFS(){
let node = this.root,
data = [],
queue = [];
queue.push(node)
while(queue.length){
node = queue.shift();
data.push(value);
if(node.left) queue.push(node.left);
if(node.right) queue.push(node.right);
}
return data;
}
DFSPreOrder(){
let data = [];
let current = this.root;
function traverse(node){
data.push(node.value);
if(node.left) traverse(node.left);
if(node.right) traverse(node.right);
}
traverse(current);
return data;
}