public static void main(String[] args) { ArrayBiTree<Integer> biTree = new ArrayBiTree<Integer>(); System.out.print("先序遍历(递归):"); biTree.preOrderRecur(1); System.out.print("\n中序遍历(递归):"); biTree.inOrderRecur(1); System.out.print("\n后序遍历(递归):"); biTree.postOrderRecur(1); System.out.print("\n层次遍历:"); biTree.levelOrder(); System.out.print("\n先序遍历(非递归):"); biTree.preOrder(); // biTree.preOrderOne(1); System.out.print("\n中序遍历(非递归):"); biTree.inOrder(1); System.out.print("\n后序遍历(非递归):"); biTree.postOrder(1); System.out.println(); biTree.stdIn(); }
2.1 输出结果相关阅读:
在Java中实现的二叉树结构