java创建二叉树并递归遍历二叉树前面已有讲解:http://www.cnblogs.com/lixiaolun/p/4658659.html. 在此基础上添加了非递归中序遍历二叉树: 二叉树类的代码: package binarytree; import linkedstack.LinkStack; import linkqueue.LinkQueue; public class BinaryTree { class Node { public Object data; public Node…
import java.util.LinkedList; public class BinaryTree { public static void main(String[] args) { int randoms[] = new int[]{67, 7, 30, 73, 10, 0, 78, 81, 10, 74}; Node roots = new Node(); for (int number : randoms) { roots.add(number); } //roots.preord…