后序遍历,顺序为左子树,右子树,根节点;
二叉搜索树的大小排序为左<根<右
根节点一定在最后,根据左字数小于根节点,右子树大于根节点的特点,将左右子树找出,然后重复进行上述操作

public class Solution {
    public boolean VerifySquenceOfBST(int [] sequence) {
        if(sequence==null)return false;
        if(sequence.length==0)return false;
        return help(sequence, 0, sequence.length-1);

    }
    public boolean help(int [] sequence, int start, int end) {
        if(end<=start)return true;
        int temp = sequence[end];
        boolean flag = false;
        int key=start;
        for(int i=start;i<end;i++){
            if(!flag&&sequence[i]>temp){
                key = i;
                flag = true;
            }
            if(flag&&sequence[i]<temp)return false;
        }
        return help(sequence, start, key-1)&&help(sequence, key, end-1);
    }
}