直接上代码:
测试类:Test
public class Test {
publicstatic void main(String[] args) {
int[] arrys= { 56, 23, 57};
BinaryTreebinaryTree = new BinaryTree();
for (int i =0; i < arrys.length; i++) {
binaryTree.insert(arrys[i]);
}
binaryTree.printTree();
}
测试类:Test
public class Test {