ocwirk
ocwirk

Reputation: 1089

Given n line segments on the plane which are either vertical or horizontal. How to count intersections between these line segments?

I have seen solutions involving sweeping line methods. But I need a divide and conquer method. Basically i want to know if we divide the plane vertically into two subplanes and then try to solve the questions on both planes, do we have to take some special step in merging?

Would there be any special advantage of using divide and conquer in this problem ?

Upvotes: 1

Views: 1195

Answers (1)

Ofir
Ofir

Reputation: 8362

The only special steps would be handling vertical lines on the division line, and breaking divided horizontal line segments.

Upvotes: 2

Related Questions