static void InOrderTraverse3(BinaryTreeNode root)
{
BinaryTreeNode temp = root.left;
Stack<BinaryTreeNode> stack = new Stack<BinaryTreeNode>();
stack.Push(root);
while (stack.Count > 0 || temp != null)
{
if (temp != null)
{ stack.Push(temp);
temp = temp.left;
}
else
{ temp = stack.Pop();
Console.WriteLine(temp.data);
temp = temp.right;
}
}
}