摘要:
https://leetcode-cn.com/problems/shu-zhi-de-zheng-shu-ci-fang-lcof/ class Solution { public double myPow(double x, int n) { if(x == 0) return 0; long 阅读全文
摘要:
https://leetcode-cn.com/problems/fei-bo-na-qi-shu-lie-lcof/ 使用动态规划 使用返回a,是因为,当使用b返回的时候需要考虑n == 0 的特例 class Solution { public int fib(int n) { int a = 阅读全文
摘要:
class Solution { public boolean verifySequenceOfBST(int [] sequence) { Stack<Integer> stack = new Stack<>(); int root = Integer.MAX_VALUE; for(int i = 阅读全文
摘要:
https://leetcode-cn.com/problems/shu-de-zi-jie-gou-lcof/ class Solution { public boolean isSubStructure(TreeNode A, TreeNode B) { return (A != null && 阅读全文
摘要:
https://leetcode-cn.com/problems/xuan-zhuan-shu-zu-de-zui-xiao-shu-zi-lcof/ 使用二分,左右指针,再mid和他们比。 https://www.acwing.com/solution/content/727/ class Sol 阅读全文