You are given n straight lines. You have to find maximum number of point of intersection with these n lines.
Input : n = 4 Output : 6 Input : n = 2 Output :1
As we have n number of line, and we have to find maximum point of intersection using these n line. So this can be done using combination. This problem can be think as number of ways to select any two line among n line. As every line intersect with other that is selected.
So, total number of points = nC2
Below is the implementation of above approach:
- Maximum points of intersection n circles
- Program for Point of Intersection of Two Lines
- Find intersection point of lines inside a section
- Minimum lines to cover all points
- Number of triangles formed from a set of points on three lines
- Find whether only two parallel lines contain all coordinates points or not
- Non-crossing lines to connect points in a circle
- Count of different straight lines with total n points with m collinear
- Maximum possible intersection by moving centers of line segments
- Maximum distinct lines passing through a single point
- Maximum number of region in which N non-parallel lines can divide a plane
- Count maximum points on same line
- Maximum number of segments that can contain the given points
- Angular Sweep (Maximum points that can be enclosed in a circle of given radius)
- Minimum number of points to be removed to get remaining points on one side of axis
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.