题目:实现一个函数,检查一棵二叉树是否为二叉查找树。
public static int index=0;
public static copyBST(TreeNode root,int [] array)
{
if(root== null) return ;
copyBST(root.left,array);
array[index]=root.data;
index++;
copyBST(root.right,array);
}
public static boolean checkBST(TreeNode root)
{