I believe all examples where the simplified algorithm fails fall in these three categories. If 3 points further down the list are colinear each other (but not with a), the algorithm handles them correctly, removing (at least) the middle one. If two or more points {b, c} further down the list are colinear with a, the algorithm also handles them correctly regardless whether the farther one from a appears first or second. This can be checked by a careful case by case analysis. Thus the algorithm can be fixed by just returning S if it has fewer than three entries, and by handling an initial segment of colinear points correctly.
.. .............. .................. .................... .................... .................... .................. .............. ..The area of the disk is pi, so the area of each square in the grid is about pi/n. The side of each square is about sqrt(pi/n). At most the two ends of each line may be vertices of the convex hull. The height of the picture is 2, so the number of points on the convex hull is no more than about 4/sqrt(pi/n), which is some constant times sqrt(n). I would expect random points to also have a number of convex hull points roughly proportional to sqrt(n). Therefore O(n1.5) expected cost for GiftWrap. [More generally boundary goes as sqrt of area, which can here be thought of as n. We hold the radius at 1 and let the points get closer together as n gets large. But equivalently, you could hold the spacing between points at approximately 1 getting a radius proportional to sqrt(n).]
bool VerifySubsetSum( setIf S has n elements and Y is a valid hint, then Y has no more than n elements, so there will be at most n iterations of the for loop. each call to S.isMember() takes at most n comparisons (lg(n) if a good data structure is used). So the total cost when the nondeterministic hint Y is valid is no more than O(n2) and the verifier is in P as is required to prove SubsetSum is in NP.S, int k, set Y ) /* S is a set of numbers, k is a target sum. These two items constitute SubsetSum input. Treat the hint Y as a proposed subset of S summing to k. */ { set ::iterator p; // Check sum while making sure Y is a subset of S. for(p = Y.begin(); p != Y.end() && S.isMember(*p) ; ++p) k -= *p; if ( p == Y.end() || k == 0) // then the hint is verified return true; else // we must resort to brute force return SlowSubsetSum(S, k); }