File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
src/main/java/com/thealgorithms/geometry Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .thealgorithms .geometry ;
2+
3+ import java .util .*;
4+
5+ public class ConvexHullTest {
6+ public static void main (String [] args ) {
7+ List <Point > points = Arrays .asList (
8+ new Point (0 , 3 ),
9+ new Point (2 , 2 ),
10+ new Point (1 , 1 ),
11+ new Point (2 , 1 ),
12+ new Point (3 , 0 ),
13+ new Point (0 , 0 ),
14+ new Point (3 , 3 )
15+ );
16+
17+ System .out .println ("Input Points:" );
18+ for (Point p : points ) System .out .print (p + " " );
19+ System .out .println ();
20+
21+ List <Point > hullBruteForce = ConvexHull .convexHullBruteForce (points );
22+ System .out .println ("\n Convex Hull (Brute Force):" );
23+ for (Point p : hullBruteForce ) System .out .print (p + " " );
24+ System .out .println ();
25+
26+ List <Point > hullRecursive = ConvexHull .convexHullRecursive (points );
27+ System .out .println ("\n Convex Hull (Recursive):" );
28+ for (Point p : hullRecursive ) System .out .print (p + " " );
29+ System .out .println ();
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments