原题地址: 344 Reverse String: https://leetcode.com/problems/reverse-string/description/ 541 Reverse String II: https://leetcode.com/problems/reverse-string-ii/description/ 题目&&解法: 1.Reverse String: Write a function that takes a string as input and ret…
LeetCode 110.平衡二叉树 分析1.0 求左子树高度和右子树高度,若高度差>1,则返回false,所以我递归了两遍 class Solution { public boolean isBalanced(TreeNode root) { if(root == null){ return true; } int left = postOrder(root.left); int right = postOrder(root.right); if(Math.abs(left-right)>1…