I need a data structute that allows
- addPoint(x, y) in O(logN)
- printDiameter() in O(logN)
where N is the current number of points in the polygon.
Obviously the two points will lie on the convex hull of the polygon. Using concept of anti-nodal pairs(Rotating-Callipers), we can find the diameter of N points is O(N).
This explains neatly the O(n) solution, but it doesn't supports insertion of point.