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.

2 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.

Leave a Reply

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