Merge pull request #923 from Jerry-306/patch-43

算法模板 js 版本代码样式微调
This commit is contained in:
程序员Carl
2021-12-03 18:24:38 +08:00
committed by GitHub

View File

@ -460,7 +460,7 @@ var levelOrder = function (root) {
for (let i = 0; i < n; i++) { for (let i = 0; i < n; i++) {
let node = queue.shift(); let node = queue.shift();
temp.push(node.val); temp.push(node.val);
node.left &&queue.push(node.left); node.left && queue.push(node.left);
node.right && queue.push(node.right); node.right && queue.push(node.right);
} }
res.push(temp); res.push(temp);