此处是链接<----MIT海龟绘图
1.问题描述
Problem 7: Convex hulls
Implement convexHull, which computes the convex hull, the smallest convex set that contains all the points in a set of input points. The gift-wrapping algorithm is one simple approach to this problem, and there are other algorithms too. Remember that 6.031 focuses on SFB/ETU/RFC, so your code will not be judged by its performance.
The specification comment above convexHull requires you to return the “minimal subset of the input points that form the vertices of the perimeter of the convex hull.” This statement is well-defined on any set of input points. What should you do for a set of 2 points? 1 point? 0 points? What should you do for a point that lies on an edge of the convex hull, but is not a vertex of that edge?
For information on how to use Java’s Set interface and classes implementing it, look up java.util.Set in the Java library documentation.
JUnit checkpoint. At this point, you should have a green check for every test when you run JUnit, and a satisfying big green bar .
Commit to Git. Once you’re happy with your solution for this problem, commit and push!
上面的描述用中文说就是:
给你一个点的集合 S S S,请你找出这个集合的子集 S 1 S_1 S1