#include "iostream"
#include "iomanip"
#include "stack"
#include "queue"
using namespace std;
struct BinaryTreeNode{
int data;
BinaryTreeNode *left;
BinaryTreeNode *right;
};
bool verifySquenceOfBST(int *number,int length)
{
if (number == NULL || length <= 0)
return false;
int root = number[length - 1];
int i = 0;
for (; i < length - 1;i++)
{
if (number[i]>root)
break;
}
int j = i;
for (; j < length - 1;j++)
{
if (number[i] < root)
return false;
}
bool left = true;
if (i>0)
left = verifySquenceOfBST(number, i);
bool right = true;
if (j<length-1)
right = verifySquenceOfBST(number + i, length - i -1);
return (left&&right);
}
int main()
{
system("pause");
return 0;
}