Page 1 of 1

Sorting points

Posted: Fri Nov 12, 2004 8:50 pm
by marcink
Could anybody tell me how to write an efficent algo for sorting points if we are given their coordinates?

Posted: Sun Nov 14, 2004 3:27 pm
by Maniac
Yes, define a relation between the points and just use quicksort or a garantueed N log N algorithm for sorting.

Posted: Mon Apr 10, 2006 12:29 pm
by Moha
define each point as a pair, because pair has < operator, and sorting it by sort function.