As far as I get it, this may be the solution :

Find out all the possible lines between those n points (total of nC2
lines). Here we define a line to be an ordered set of 2 points where
the first point is < 2nd point (ie. length of origin to first point is
< length of origin from 2nd point). Then we sort them by their slope
value as primary key and starting point as secondary key.

>From the sorted list identify the longest sequence of the same slope
and same starting point. Th length of this sequence is the required
answer.

Thus the complexity turns out to be :
O(n^2) : for identifying nC2 lines.
O(n^2*log_m) : for sorting those lines (where m is the different
number of unique slope)
O(n^2) : for identifying the longest sequence

So the complexity comes to : O(n^2*log_m)

What does everybody think on this?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to