mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-11 04:54:51 +08:00
update 0102.二叉树的层序遍历.md 515java解法二format
This commit is contained in:
@ -1079,6 +1079,7 @@ class Solution {
|
|||||||
Queue<TreeNode> queue = new LinkedList<TreeNode>();
|
Queue<TreeNode> queue = new LinkedList<TreeNode>();
|
||||||
List<Integer> result = new ArrayList<>();
|
List<Integer> result = new ArrayList<>();
|
||||||
if (root != null) queue.add(root);
|
if (root != null) queue.add(root);
|
||||||
|
|
||||||
while(!queue.isEmpty()){
|
while(!queue.isEmpty()){
|
||||||
int size = queue.size();
|
int size = queue.size();
|
||||||
int max = Integer.MIN_VALUE; // 初始化为最小值
|
int max = Integer.MIN_VALUE; // 初始化为最小值
|
||||||
|
Reference in New Issue
Block a user