Reputation: 11
Can we do better?
What if I have to find whether any two lines are parallel and that's it.Can we do that without finding all the lines?
Upvotes: 0
Views: 100
Reputation:
As the coordinates are integer, you can use a hash table to store the N² slopes; represent them as irreducible fractions. This should limit the search for equal values to O(N²).
Upvotes: 1