leetcode.2583专题

LeetCode.2583. 二叉树中的第 K 大层和

题目 2583. 二叉树中的第 K 大层和 分析 这道题其实考察的是二叉树的层序遍历,下面我介绍一个二叉树的层序遍历模版: public List<List<Integer>> levelOrder(TreeNode root) {// 记录最终的结果List<List<Integer>> res = new ArrayList<>();if(root == null) retu