摘要: 您需要在二叉树的每一行中找到最大的值。 示例: 输入: 1 / \ 3 2 / \ \ 5 3 9 输出: [1, 3, 9] 解法一:宽度优先搜索 List<Integer> res = new ArrayList<>(); public List<Integer> largestValues(T 阅读全文
posted @ 2021-06-17 20:40 zhustarstar 阅读(30) 评论(0) 推荐(0) 编辑