How to O(n*n) online convex hull constructrion

Правка en1, от purple_dreams, 2017-05-19 10:29:16

By Graham Scan O(n*n*logn) would be possible for online construction of convex hull. Can you help me with O(n*n) algorithm. Also what is the difference between 2D CH construction and 3D CH construction

And in graham scan there is a function to sort according to polar order which i did not understand. Please help.

bool polar_order(Point a, Point b){
        //ccw is a function that returns 0 if collinear -1 if counter-clockwise and 1 if clockwise
        //pivot is the lowest y-coordinate point(tie broken by lowest x-coordinate)
	int order = ccw(pivot,a,b);
	if(order==0)
		return sqrdist(pivot,a) < sqrdist(pivot,b);
	return (order==-1);
}

Also if there are some problems you know of convex hull, please share them. Thank you.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский purple_dreams 2017-05-19 10:29:16 811 Initial revision (published)