
You need to find the largest value in each row of a binary tree.
Example
Input:
1 |
1 |
Output: [1, 3, 9]
Code
1 |
public class { |
1 |
public List<Integer> largestValues(TreeNode root) { |

You need to find the largest value in each row of a binary tree.
Input:
1 |
1 |
Output: [1, 3, 9]
1 |
public class { |
1 |
public List<Integer> largestValues(TreeNode root) { |
近期评论