Home /
Expert Answers /
Computer Science /
consider-the-following-rectangle-figure-there-are-two-parallel-blue-lines-opposite-sides-of-t-pa244
(Solved):
Consider the following rectangle figure. There are: - two parallel blue lines (opposite sides of t ...
Consider the following rectangle figure. There are: - two parallel blue lines (opposite sides of the rectangle) - two parallel red lines (opposite sides of the rectangle) - black lines that go from a red line to its opposite red line. - black lines that go from a blue line to its opposite blue line. You may assume that the input is given to you as follows: - The equations of the two red lines and the two blues lines. - A set of R black lines going from red to red along with their equations. - A set of B black lines going from blue to blue along with their equations. - No two black lines share an end point either on a red line or a blue line. Give an algorithm to count how many pairs of lines intersect (shown by little circles in the figure). State the complexity of your algorithm. If you are using any algorithm taught in class, you can just state "I use algorithm A with input I which gives me output O".