(int d)
| 73 | } |
| 74 | |
| 75 | public TreeNode find(int d) { |
| 76 | if (d == data) { |
| 77 | return this; |
| 78 | } else if (d <= data) { |
| 79 | return left != null ? left.find(d) : null; |
| 80 | } else if (d > data) { |
| 81 | return right != null ? right.find(d) : null; |
| 82 | } |
| 83 | return null; |
| 84 | } |
| 85 | |
| 86 | private static TreeNode createMinimalBST(int arr[], int start, int end){ |
| 87 | if (end < start) { |