打印出来的是8 3 1 是什么原因
var nodes = [8,3,10,1,6,14,4,7,13];
var binaryTree = new BinaryTree();
nodes.forEach(function(key){
binaryTree.insert(key);
})
var callback = function(key){
console.log(key)
}
binaryTree.inOrderTraverse(callback);
var nodes = [8,3,10,1,6,14,4,7,13];
var binaryTree = new BinaryTree();
nodes.forEach(function(key){
binaryTree.insert(key);
})
var callback = function(key){
console.log(key)
}
binaryTree.inOrderTraverse(callback);
2019-06-11
举报