File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/main/java/com/thealgorithms/randomized Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
package com .thealgorithms .randomized ;
2
2
import java .math .BigDecimal ;
3
3
import java .math .RoundingMode ;
4
- import java .util .*;
4
+ import java .util .ArrayList ;
5
+ import java .util .Collections ;
6
+ import java .util .Comparator ;
7
+ import java .util .List ;
5
8
6
9
// As required by Repository, new algorithms have URL in comments with explanation
7
10
// https://www.geeksforgeeks.org/closest-pair-of-points-using-divide-and-conquer-algorithm
@@ -47,7 +50,9 @@ public static double closest(List<Point> points) {
47
50
48
51
private static double closestRecursiveHelper (List <Point > points , int left , int right ) {
49
52
// Base Case occurs with 3 or fewer points
50
- if (right - left <= 2 ) return baseCase (points , left , right );
53
+ if (right - left <= 2 ) {
54
+ return baseCase (points , left , right );
55
+ }
51
56
52
57
// Divide and conquer
53
58
int mid = (left + right ) / 2 ;
You can’t perform that action at this time.
0 commit comments