摘要: public boolean IsBalanced_Solution(TreeNode root) { return getDepth(root) != -1; } private int getDepth(TreeNode root) { if (root == null) return 0; i 阅读全文
posted @ 2019-12-18 13:22 CodeCorner 阅读(462) 评论(0) 推荐(0)
摘要: public class Solution { public int TreeDepth(TreeNode root) { if(root == null){ return 0; } int left = TreeDepth(root.left); int right = TreeDepth(roo 阅读全文
posted @ 2019-12-18 13:10 CodeCorner 阅读(311) 评论(0) 推荐(0)
摘要: public class Solution { public ListNode ReverseList(ListNode head) { if(head==null) return null; //head为当前节点,如果当前节点为空的话,那就什么也不做,直接返回null; ListNode pre 阅读全文
posted @ 2019-12-18 13:04 CodeCorner 阅读(1325) 评论(0) 推荐(0)