mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-11 04:54:51 +08:00
update 方法二 0102.二叉树的层序遍历.md 515题java format
This commit is contained in:
@ -1070,8 +1070,10 @@ class Solution {
|
|||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
方法二:用一个max变量来保存最大值
|
```java
|
||||||
|
//方法二:用一个max变量来保存最大值
|
||||||
class Solution {
|
class Solution {
|
||||||
public List<Integer> largestValues(TreeNode root) {
|
public List<Integer> largestValues(TreeNode root) {
|
||||||
Queue<TreeNode> queue = new LinkedList<TreeNode>();
|
Queue<TreeNode> queue = new LinkedList<TreeNode>();
|
||||||
|
Reference in New Issue
Block a user