摘要: 链接:https://leetcode-cn.com/problems/zhong-jian-er-cha-shu-lcof/ 思路: 使用map存储中序遍历各节点对应的下标,整个算法使用深搜思想,主要是确定各边界。k 为根结点对应的下标。 dfs左子树:前序:(pl + 1, pl + k - i 阅读全文
posted @ 2020-02-16 16:05 景云ⁿ 阅读(66) 评论(0) 推荐(0)
摘要: 链接:https://leetcode-cn.com/problems/yong-liang-ge-zhan-shi-xian-dui-lie-lcof/ 代码: class CQueue { public: stack<int> stack_a; stack<int> stack_b; CQueu 阅读全文
posted @ 2020-02-16 15:18 景云ⁿ 阅读(73) 评论(0) 推荐(0)