Gerrymandering is a process where voting districts are drawn to achieve various political goals, such as maximizing

Question:

Gerrymandering is a process where voting districts are drawn to achieve various political goals, such as maximizing the number of voters from a certain party, rather than to achieve geometric goals, such as having districts drawn to have generally round or square shapes. This process often gives rise to very complicated shapes for voting districts, and it can sometimes be challenging to determine whether a giving person is inside or outside a given district, due to the ways it can wind around. Suppose, then, that you are given a voting district defined by an n-vertex simple polygon, P. Give an O(n)-time algorithm for testing whether a point q is inside or outside of P. You may assume that q is not on the boundary of P and that there is no vertex of P with the same x-coordinate as q.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Algorithm Design And Applications

ISBN: 9781118335918

1st Edition

Authors: Michael T. Goodrich, Roberto Tamassia

Question Posted: