Determine if set of points is convex.

This problem asks whether a given set of points is convex or not. A set of points is convex if, for any two points in the set, the line segment connecting them lies entirely within the set.

Problem

Given a set of points in the plane, determine whether or not the set is convex.
Input: A set of points in the plane.
Output: A Boolean value indicating whether or not the set is convex.

Solution

by elrichendelgart
A set of points is convex if, for every pair of points in the set, the line segment connecting those points is entirely contained in the set.

To determine whether or not a set of points is convex, we can check whether or not the line segment connecting every pair of points in the set is entirely contained in the set. This can be done in O(n^2) time, where n is the number of points in the set.

A.I. Evaluation of the Solution

The candidate's solution is correct and demonstrates a level of completeness. The approach is straightforward and easy to understand.

Evaluated at: 2022-11-13 00:16:24