@@ -0,0 +1,834 @@
+package Chapter1.Section2;%0A%0Aimport edu.princeton.cs.algs4.Point2D;%0Aimport edu.princeton.cs.algs4.StdOut;%0A%0Apublic class Exercise01%0A%7B%0A    public static void main (String%5B%5D args)%0A    %7B%0A%09int N = Integer.parseInt(args%5B0%5D);%0A%0A%09Point2D%5B%5D points = new Point2D%5BN%5D;%0A%0A%09for (int ii = 0; ii %3C points.length; ii++)%0A%09%7B%0A%09    double x = Math.random();%0A%09    double y = Math.random();%0A%0A%09    points%5Bii%5D = new Point2D(x, y);%0A%09%7D%0A%0A%09double smallestDistance = Double.MAX_VALUE;%0A%09for (int main = 0; main %3C points.length; main++)%0A%09%7B%0A%09    for (int to = 0; to %3C points.length; to++)%0A%09    %7B%0A%09%09if (main != to)%0A%09%09%7B%0A%09%09    double distance = points%5Bmain%5D.distanceTo(points%5Bto%5D);%0A%0A%09%09    smallestDistance = Math.min(smallestDistance, distance);%0A%09%09%7D%0A%09    %7D%0A%09%7D%0A%0A%09StdOut.println(%22Smallest distance between %22%0A%09    + N%0A%09    + %22 point(s) is %22 %0A%09    + smallestDistance);%0A    %7D%0A%7D%0A

Solved 1.2.1