code: private double max(ArrayList<DistanceSet> v) {
          double max = 0.0;
          for (DistanceSet n : v) {
              if (max < n.dist.get(n.dist.size() - 1)) {
                  max = n.dist.get(n.dist.size() - 1);
              }
          }
          return max;
      }
docs: Returns the max distance of the reference point p in current node to
  it's children nodes.
  @param v the stack of DistanceNode objects.
  @return the distance of the furthest child.