hey, i want to do a question in which i am given n line segments and i want to find the number of intersection of them. Can anyone tell me the most efficient way i can do it ? I have got some links on google and also from books but i am not getting it. I am not asking for code or something like that and neither it is my homework. So please help me if you can. thanks
nitin1
15
Master Poster
Recommended Answers
Jump to PostSuppose I have 1 line, its doesn't has any intersection so p(1) = 0
Now introducing another line, it cuts p(1) at atmost 1 point so p(2) = 1
Again introduce another line, it will intersect above 2 lines in atmost 2 points, but we already have one intersection point …
All 4 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
nitin1
15
Master Poster
np complete
8
Newbie Poster
GudduNP
commented:
great
+0
rithish
13
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.