📅  最后修改于: 2022-03-11 15:01:57.451000             🧑  作者: Mango
// Day 23: BST Level-Order Traversal hackerrank solution javascript
var queue = [root];
while (queue.length > 0) {
var node = queue.shift();
write(node.data + " ");
if (node.left) {
queue.push(node.left);
}
if (node.right) {
queue.push(node.right);
}
}
function write(str) {
process.stdout.write(str);
}