File tree Expand file tree Collapse file tree
src/main/java/com/thealgorithms/randomized Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .thealgorithms .randomized ;
22import java .math .BigDecimal ;
33import 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 ;
58
69// As required by Repository, new algorithms have URL in comments with explanation
710// https://www.geeksforgeeks.org/closest-pair-of-points-using-divide-and-conquer-algorithm
@@ -47,7 +50,9 @@ public static double closest(List<Point> points) {
4750
4851 private static double closestRecursiveHelper (List <Point > points , int left , int right ) {
4952 // 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+ }
5156
5257 // Divide and conquer
5358 int mid = (left + right ) / 2 ;
You can’t perform that action at this time.
0 commit comments