소스복사하기
본문내용 |
Point[] xSorted = new Point[numberOfPoints]; Point[] ySorted = new Point[numberOfPoints]; System.arraycopy(points, 0, xSorted, 0, numberOfPoints); System.arraycopy(points, 0, ySorted, 0, numberOfPoints); Arrays.sort(xSorted); Arrays.sort(ySorted, new PointComparatorByY()); double minDistance2 = closestPairDNC(xSorted, ySorted); System.out.printf("distance from closestPairDNC = %.2f \n\n", minDistance2); assert (minDistance1 == minDistance2); |