コードを変更しようとしていますが、タイトルに記載されているエラーが発生しました。誰か助けてください。
エラー: BruteCollinearPoints 型のセグメント () メソッドは、引数 (ポイント、ポイント) には適用できません。
import java.util.Collections;
import java.util.ArrayList;
import java.util.List;
import edu.princeton.cs.algs4.*;
public class BruteCollinearPoints
{
public BruteCollinearPoints(Point[] points) // finds all line segments containing 4 points
{
int N = points.length;
int i = 0;
for (int p = 0; p < N; p++) {
for (int q = p + 1; q < N; q++) {
double slopeToQ = points[p].slopeTo(points[q]);
for (int r = q + 1; r < N; r++) {
double slopeToR = points[p].slopeTo(points[r]);
if (slopeToQ == slopeToR) {
for (int s = r + 1; s < N; s++) {
double slopeToS = points[p].slopeTo(points[s]);
if (slopeToQ == slopeToS) {
// Create the list of collinear points and sort them.
List<Point> collinearPoints = new ArrayList<Point>(4);
collinearPoints.add(points[p]);
collinearPoints.add(points[q]);
collinearPoints.add(points[r]);
collinearPoints.add(points[s]);
Collections.sort(collinearPoints);
segments(Collections.min(collinearPoints), Collections.max(collinearPoints)); //this is where the error is
}
}
}
}
}
}
}
//public int numberOfSegments(); // the number of line segments
public LineSegment[] segments() // the line segments
{
return segments();
}
}