Given that denotes a set of point, the pseudocode shown below checks if lines are collinear by checking if the point ,, and are collinear, where is the central point, by checking if the the slopes of the segments and are identical.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
What is the worst case running time of the algorithm?
The following text file contains a set of triplets. Each triplets contains three integers , representing a circle of radius centered at . Out of each pair of circles in the file, how may of them intersect?
How many of the pairs of line segments in this text file intersect?
Details and assumption