(int N, int min, int max)
| 169 | } |
| 170 | |
| 171 | public static TreeNode randomBST(int N, int min, int max) { |
| 172 | int d = randomIntInRange(min, max); |
| 173 | TreeNode root = new TreeNode(d); |
| 174 | for (int i = 1; i < N; i++) { |
| 175 | root.insertInOrder(randomIntInRange(min, max)); |
| 176 | } |
| 177 | return root; |
| 178 | } |
| 179 | |
| 180 | /* Creates tree by mapping the array left to right, top to bottom. */ |
| 181 | public static TreeNode createTreeFromArray(int[] array) { |
no test coverage detected