摘要: 递归复习2题: 1、leetcode 92.反转链表II public ListNode reverseBetween(ListNode head, int m, int n) { // 定义一个dummyHead, 方便处理 ListNode dummyHead = new ListNode(0) 阅读全文
posted @ 2021-05-30 21:13 shouhugyl 阅读(52) 评论(0) 推荐(0)
摘要: 104. 二叉树的最大深度 class Solution { public int maxDepth(TreeNode root) { if (root == null) { return 0; } int maxChild = Math.max(maxDepth(root.left), maxDe 阅读全文
posted @ 2021-05-16 20:31 shouhugyl 阅读(46) 评论(0) 推荐(0)