ConvexHull and LCS for algorithm homework