The Bentley???Ottman algorithm will insert a new segment s into this data structure when the sweep line L crosses the left endpoint p of this segment; the correct position of s in the binary search tree may be determined by a binary search, each step of which tests whether p is above or below some other segment that is crossed by L. Thus, an insertion may be performed in logarithmic time.