How to construct binary tree for this 2d-geometric constellation
Given non horizontal random line segments in $mathbb{R^2}$ in terms of their endpoint coordinates that do not intersect and do not share the same $y$-value in their endpoints, I want to (efficiently) construct a binary tree satisfying the following: