@Test public void randomTest() { int N = 100000; Random r = new Random(); for (int i = 10; i < N; i += r.nextInt(i)) { TreeNode root = TreeNode.buildBT(i); List<TreeNode> res = PreorderWithConstantSpace.solve(root); List<TreeNode> expect = expect(root); Assert.assertArrayEquals(expect.toArray(new TreeNode[0]), res.toArray(new TreeNode[0])); } }
public static List<TreeNode> solve(TreeNode root) { return null; }
PreorderWithConstantSpace { public static List<TreeNode> solve(TreeNode root) { return null; } }
PreorderWithConstantSpace { public static List<TreeNode> solve(TreeNode root) { return null; }  }
PreorderWithConstantSpace { public static List<TreeNode> solve(TreeNode root) { return null; }  static List<TreeNode> solve(TreeNode root); }
PreorderWithConstantSpace { public static List<TreeNode> solve(TreeNode root) { return null; }  static List<TreeNode> solve(TreeNode root);  }