-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinput1.txt
55 lines (44 loc) · 1.14 KB
/
input1.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
BinaryTree<Integer> btree = new BinaryTree<Integer>(20);
btree.insert(10);
btree.insert(5);
btree.insert(15);
btree.insert(12);
btree.insert(30);
btree.insert(25);
btree.insert(35);
btree.levelOrder();
btree.delete(10);
System.out.println("\n");
btree.levelOrder();
btree.delete(12);
System.out.println("\n");
btree.levelOrder();
btree.delete(30);
System.out.println("\n");
btree.levelOrder();
btree.delete(15);
System.out.println("\n");
btree.levelOrder();
btree.delete(20);
System.out.println("\n");
btree.levelOrder();
btree.delete(25);
System.out.println("\n");
btree.levelOrder();
btree.delete(35);
System.out.println("\n");
btree.levelOrder();
btree.delete(5);
System.out.println("\n");
btree.levelOrder();
//System.out.println(btree.contains(15));
BinaryTree<String> btree = new BinaryTree<String>("east");
btree.insert("at");
btree.insert("eat");
btree.insert("am");
btree.insert("ate");
btree.insert("ear");
btree.preOrder();
System.out.println();
TreeNode<String> node = btree.getNodeDetails("at");
System.out.println(node.toString());