@@ -35,7 +35,7 @@ public void testXPartition() {
35
35
points [4 ] = cp .buildLocation (3.0 , 2.0 );
36
36
37
37
int pivotIndex = cp .xPartition (points , 0 , 4 );
38
- assertEquals (2 , pivotIndex ); // After partition, pivot should be at index 2
38
+ assertEquals (2 , pivotIndex );
39
39
assertEquals (2.0 , points [0 ].x );
40
40
assertEquals (1.0 , points [1 ].x );
41
41
assertEquals (3.0 , points [2 ].x );
@@ -54,7 +54,7 @@ public void testYPartition() {
54
54
points [4 ] = cp .buildLocation (3.0 , 2.0 );
55
55
56
56
int pivotIndex = cp .yPartition (points , 0 , 4 );
57
- assertEquals (1 , pivotIndex ); // After partition, pivot should be at index 1
57
+ assertEquals (1 , pivotIndex );
58
58
assertEquals (2.0 , points [1 ].y );
59
59
assertEquals (3.0 , points [4 ].y );
60
60
assertEquals (1.0 , points [0 ].y );
@@ -68,9 +68,8 @@ public void testBruteForce() {
68
68
ClosestPair .Location loc1 = cp .buildLocation (1.0 , 2.0 );
69
69
ClosestPair .Location loc2 = cp .buildLocation (4.0 , 6.0 );
70
70
71
- // Use the bruteForce method and pass the locations as an array
72
71
ClosestPair .Location [] locations = new ClosestPair .Location [] {loc1 , loc2 };
73
72
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 );
75
74
}
76
75
}
0 commit comments