摘要:
https://oj.leetcode.com/problems/merge-intervals/合并区间//排序sort(intervals.begin(),intervals.end(),CMPFUN);bool CMPFUN(Interval a, Interval b){ return...
阅读全文
摘要:
https://oj.leetcode.com/problems/recover-binary-search-tree/一棵二叉搜索树,二叉搜索树的特征是,中根遍历的话,得到的序列是递增的题目中,有两个节点弄混了,让恢复这个二叉搜索树class Solution {public: TreeNo...
阅读全文
摘要:
https://oj.leetcode.com/problems/powx-n/二分法class Solution {public: double pow(double x, int n) { double ans = 1; if(n == 0) ...
阅读全文
摘要:
https://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/接上一题目,输入的树不是perfect的。在这里深搜就不好使了。因为,在你往下深搜的时候,可能上一行的next还没处理到那里,所以会丢失信息...
阅读全文