Skip to content

Commit 811de62

Browse files
committed
Improved formatting of the code
1 parent 0b0ac3d commit 811de62

2 files changed

Lines changed: 4 additions & 21 deletions

File tree

src/main/java/com/thealgorithms/randomized/RandomizedClosestPair.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.thealgorithms.randomized;
22

3+
import java.util.ArrayList;
34
import java.util.Arrays;
45
import java.util.Collections;
56
import java.util.Comparator;
67
import java.util.List;
7-
import java.util.ArrayList;
88
import java.util.Random;
99

1010
/**

src/test/java/com/thealgorithms/randomized/RandomizedClosestPairTest.java

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,21 @@ public class RandomizedClosestPairTest {
99

1010
@Test
1111
public void testFindClosestPairDistance() {
12-
Point[] points = {
13-
new Point(1, 1),
14-
new Point(2, 2),
15-
new Point(3, 3),
16-
new Point(8, 8),
17-
new Point(13, 13)
18-
};
19-
12+
Point[] points = {new Point(1, 1), new Point(2, 2), new Point(3, 3), new Point(8, 8), new Point(13, 13)};
2013
double result = RandomizedClosestPair.findClosestPairDistance(points);
2114
assertEquals(Math.sqrt(2), result, 0.00001);
2215
}
2316

2417
@Test
2518
public void testWithIdenticalPoints() {
26-
Point[] points = {
27-
new Point(0, 0),
28-
new Point(0, 0),
29-
new Point(1, 1)
30-
};
31-
19+
Point[] points = {new Point(0, 0), new Point(0, 0), new Point(1, 1)};
3220
double result = RandomizedClosestPair.findClosestPairDistance(points);
3321
assertEquals(0.0, result, 0.00001);
3422
}
3523

3624
@Test
3725
public void testWithDistantPoints() {
38-
Point[] points = {
39-
new Point(0, 0),
40-
new Point(5, 0),
41-
new Point(10, 0)
42-
};
43-
26+
Point[] points = {new Point(0, 0), new Point(5, 0), new Point(10, 0)};
4427
double result = RandomizedClosestPair.findClosestPairDistance(points);
4528
assertEquals(5.0, result, 0.00001);
4629
}

0 commit comments

Comments
 (0)