1 int max(Node t) {
2 if(t == null)
3 return 0;
4 while (t.right != null)
5 t = t.right;
6 System.out.println(t.data);
7 return t.data;
8 }
9 //Node max(Node t) {
10 // if (t.right != null) {
11 // return min(t.right);
12 //}
13 //return t;
14 //}
15 int min(Node t) {
16 if(t == null)
17 return 0;
18 while (t.left != null)
19 t = t.left;
20 System.out.println(t.data);
21 return t.data;
22 }
23 //Node min(Node t) {
24 // if (t.left != null) {
25 // return min(t.left);
26 //}
27 //return t;
28 //}