"Separation" means each line segment in the S are all in the side of the line L, L and straight with no a line segment intersection, below blue line separating red line segment set
Now required to do the collection S preprocessing, and then to a straight line, any query whether "separation" time complexity as logn.
How to make pretreatment excuse me? Give a thought can be ~
I wish you all a happy New Year!
CodePudding user response:
If after pretreatment, you can put all the inside of the S line, into L as X, or Y axis coordinate system in line, and sorted, then binary search, the time complexity is O (LOGN)CodePudding user response: