摘要:
斐波那契数列 long long mod = 1e9 + 7; int fib(int n) { if (n < 2) return n; int prepre = 0, pre = 1, res; for (int i = 2; i <= n; i++) { res = (prepre % mod 阅读全文
摘要:
没做过这种类型的题,树怎么比较? 我好像一下子不会写怎么用迭代写法遍历一棵树 嗯,看以前的笔记是用栈 这一题算是树的遍历的组合题 class Solution { public: bool isSubStructure(TreeNode* A, TreeNode* B) { if (!B || !A 阅读全文