Skip to content

Commit 4f6a122

Browse files
committed
Fix comments
1 parent 0a14c7c commit 4f6a122

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/test/java/com/thealgorithms/divideandconquer/ClosestPairTest.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void testXPartition() {
3535
points[4] = cp.buildLocation(3.0, 2.0);
3636

3737
int pivotIndex = cp.xPartition(points, 0, 4);
38-
assertEquals(2, pivotIndex); // After partition, pivot should be at index 2
38+
assertEquals(2, pivotIndex);
3939
assertEquals(2.0, points[0].x);
4040
assertEquals(1.0, points[1].x);
4141
assertEquals(3.0, points[2].x);
@@ -54,7 +54,7 @@ public void testYPartition() {
5454
points[4] = cp.buildLocation(3.0, 2.0);
5555

5656
int pivotIndex = cp.yPartition(points, 0, 4);
57-
assertEquals(1, pivotIndex); // After partition, pivot should be at index 1
57+
assertEquals(1, pivotIndex);
5858
assertEquals(2.0, points[1].y);
5959
assertEquals(3.0, points[4].y);
6060
assertEquals(1.0, points[0].y);
@@ -68,9 +68,8 @@ public void testBruteForce() {
6868
ClosestPair.Location loc1 = cp.buildLocation(1.0, 2.0);
6969
ClosestPair.Location loc2 = cp.buildLocation(4.0, 6.0);
7070

71-
// Use the bruteForce method and pass the locations as an array
7271
ClosestPair.Location[] locations = new ClosestPair.Location[] {loc1, loc2};
7372
double result = cp.bruteForce(locations);
74-
assertEquals(5.0, result, 0.01); // Distance between (1, 2) and (4, 6)
73+
assertEquals(5.0, result, 0.01);
7574
}
7675
}

0 commit comments

Comments
 (0)