//二叉查找树的中序遍历LNR,可以得到一个递增的有序数列
public void inOrder(TreeNode<Integer> node){
Stack<TreeNode<Integer>> nodeStack = new Stack<TreeNode<Integer>>();
TreeNode<Integer> tempNode = node; //遍历指针
while(tempNode != null || !nodeStack.isEmpty()){
if(tempNode != null){
nodeStack.push(tempNode);
tempNode = tempNode.getLchild();
}else{
tempNode = nodeStack.pop();
System.out.print(tempNode.getData() + " ");
tempNode = tempNode.getRchild();
}
}
}
3. 得到二叉查找树的最大值和最小值: