@Test public void testVsNaiveRandomly() { final int TRIALS = 100000; for (int i = 0; i < TRIALS; i++) { int len = rand.nextInt(100); List<Point> points = new ArrayList<>(); if (rand.nextBoolean()) { for (int j = 0; j < len; j++) points.add(new Point(rand.nextGaussian(), rand.nextGaussian())); } else { for (int j = 0; j < len; j++) points.add(new Point(rand.nextInt(10), rand.nextInt(10))); } List<Point> actual = ConvexHull.makeHull(points); List<Point> expected = makeHullNaive(points); assertEquals(expected, actual); } }
public static List<Point> makeHull(List<Point> points) { List<Point> newPoints = new ArrayList<>(points); Collections.sort(newPoints); return makeHullPresorted(newPoints); }
ConvexHull { public static List<Point> makeHull(List<Point> points) { List<Point> newPoints = new ArrayList<>(points); Collections.sort(newPoints); return makeHullPresorted(newPoints); } }
ConvexHull { public static List<Point> makeHull(List<Point> points) { List<Point> newPoints = new ArrayList<>(points); Collections.sort(newPoints); return makeHullPresorted(newPoints); }  }
ConvexHull { public static List<Point> makeHull(List<Point> points) { List<Point> newPoints = new ArrayList<>(points); Collections.sort(newPoints); return makeHullPresorted(newPoints); }  static List<Point> makeHull(List<Point> points); static List<Point> makeHullPresorted(List<Point> points); }
ConvexHull { public static List<Point> makeHull(List<Point> points) { List<Point> newPoints = new ArrayList<>(points); Collections.sort(newPoints); return makeHullPresorted(newPoints); }  static List<Point> makeHull(List<Point> points); static List<Point> makeHullPresorted(List<Point> points);  }