Dhyanesh:
I am failing to see your point.
Imagine a circle with origin as the center. You can very well imagine
two chords parallel to x-axis. Say one is diameter and the other is
some chord little above the diameter. These two don't intersect. How
can two parallel chords in a circle intersect?

Karas: Can you please explain your code?

By the way, this problem was supposed to use Balanced Binary Search
Tree. Any ideas?
More over I think your algos are also finding which pairs intersect.
Remember that in the worst case of all chords being diameters, every
pair intersects to the answer is n(n-1)/2 which is O(n^2). How can you
find all the O(n^2) intersections in O(n log(n) time?
The question does not ask to find all the pairs but just to "count"
them.


--~--~---------~--~----~------------~-------~--~----~
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