Skip to content

Commit 9eb7a95

Browse files
clang format GrahamScan.java
1 parent 22a8eff commit 9eb7a95

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/main/java/com/thealgorithms/geometry/GrahamScan.java

-4
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ public class GrahamScan {
1919
private final Stack<Point> hull = new Stack<>();
2020

2121
public GrahamScan(Point[] points) {
22-
2322
// Validate input data
2423
if (points == null || points.length < 3) {
2524
throw new IllegalArgumentException("At least 3 points are required to compute the convex hull");
2625
}
27-
2826
// Check if all points are the same
2927
boolean allSame = true;
3028
for (int i = 1; i < points.length; i++) {
@@ -33,12 +31,10 @@ public GrahamScan(Point[] points) {
3331
break;
3432
}
3533
}
36-
3734
if (allSame) {
3835
hull.push(points[0]);
3936
return;
4037
}
41-
4238
// Pre-process points: sort by y-coordinate, then by polar order with respect to the first point
4339
Arrays.sort(points);
4440
Arrays.sort(points, 1, points.length, points[0].polarOrder());

0 commit comments

Comments
 (0)