Question: Let P be a convex polygon whose vertices are stored in an array in counter-clockwise order. Provide an O(log n) time algorithm for computing the
Let P be a convex polygon whose vertices are stored in an array in counter-clockwise order.
Provide an O(log n) time algorithm for computing the distance from P to a query point q that lies outside of P.

Please give the pseudo code and the steps about how to solve the two problems in the above picture. Thank you!
input: list of vertices of the convex polygon, such as {p3, p4, p2, p1} shown in the figure question 1
output: the distance from P to q
1 P. 2. 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
