mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-10 20:40:39 +08:00
Merge pull request #620 from leiyaguang/patch-1
Update 0102.二叉树的层序遍历.md
This commit is contained in:
@ -1129,7 +1129,7 @@ var largestValues = function(root) {
|
|||||||
queue.push(root);
|
queue.push(root);
|
||||||
while(root!==null&&queue.length){
|
while(root!==null&&queue.length){
|
||||||
//设置max初始值就是队列的第一个元素
|
//设置max初始值就是队列的第一个元素
|
||||||
let max=queue[0];
|
let max=queue[0].val;
|
||||||
let length=queue.length;
|
let length=queue.length;
|
||||||
while(length--){
|
while(length--){
|
||||||
let node = queue.shift();
|
let node = queue.shift();
|
||||||
|
Reference in New Issue
Block a user