摘要:
根据前序遍历和中序遍历还原二叉树: include include include include using namespace std; struct TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) : val 阅读全文
posted @ 2019-09-20 21:25
夜深不自知
阅读(211)
评论(0)
推荐(0)
摘要:
普通快速排序代码如下 include include include include using namespace std; int getindex(vector&arr,int left,int right){ int m=arr[left]; while(left=m) right ; ar 阅读全文
posted @ 2019-09-20 20:01
夜深不自知
阅读(128)
评论(0)
推荐(0)
摘要:
题目描述 输入一个整数数组,判断该数组是不是某二叉搜索树的后序遍历的结果。如果是则输出Yes,否则输出No。假设输入的数组的任意两个数字都互不相同。 class Solution { public: bool validate(vector&arr,int left,int right){ if(l 阅读全文
posted @ 2019-09-20 15:35
夜深不自知
阅读(328)
评论(0)
推荐(0)

浙公网安备 33010602011771号