In: Computer Science
A convex polygon is defined as a polygon where all its internal angles are less than 180 degrees and no edges cross each other. You can assume the vertex with the smallest x-coordinate (assuming origin at bottom left) is the first coordinate and other vertices are numbered in a counter-clockwise direction. Figure 1 shows an example of such a polygon where V[1] is the first polygon. For simplicity, you can also assume all polygon vertices have distinct x and y co-ordinates.
Given such a polygon, write an efficient algorithm to find:
(a) The polygon vertex with the maximum x-coordinate. Also provide the running time of the algorithm in the tightest bound possible.
(b) The polygon vertex with the maximum y-coordinate. Also provide the running time of the algorithm in the tightest bound possible.