Solution to Polygon-Concavity-Index by codility

18 Oct

Question: https://codility.com/demo/take-sample-test/polygon_concavity_index/

Question Name: Polygon-Concavity-Index or PolygonConcavityIndex

Thanks to Robert Sedgewick, the Youtube video (Algorithms, Part I – Convex Hull) tells everything about this problem.

5 Replies to “Solution to Polygon-Concavity-Index by codility

  1. Hi! I do not understand how exactly to do it in languages that can have arithmetic overflow in functions like _IsClockwise. Levi

    • hmm~ Good catch! Python does not have the overflow issue. And Java has BigInteger/BigDecimal. For C/C++, you can have a similar big number class or use more if-else in overflow detection.

  2. Is following code really required in above solution?

  3. This is my C++ solution:
    https://app.codility.com/demo/results/trainingFPR47Z-YXZ/

Leave a Reply

Your email address will not be published. Required fields are marked *

Please put your code into a <pre>YOUR CODE</pre> section. Thanks and Happy Coding!