摘要: public Node connect(Node root) { if(root == null) return root; Deque<Node> q = new LinkedList(); q.offer(root); while(!q.isEmpty()) { int size = q.siz 阅读全文
posted @ 2022-02-18 22:43 明卿册 阅读(11) 评论(0) 推荐(0) 编辑
摘要: public int minDepth(TreeNode root) { int depth = 0; if(root == null) return depth; Deque<TreeNode> q = new LinkedList(); q.offer(root); while(!q.isEmp 阅读全文
posted @ 2022-02-18 22:36 明卿册 阅读(11) 评论(0) 推荐(0) 编辑