I got stuck at this problem while trying to learn sweep line technique. I've read the editorial for that problem and got seriously confused at the "y coordinate for a segment" part. Like ... how can we compare the y coordinate when a segment consist of two points ? (Apparently I think it has something to do with sorting points by increasing x coordinate, but can't figure out why ...). Also why do we only check for intersection with the "above" segment in the active
set when we first meet the beginning of a segment, but check for both the "above" and "below" when we meet a segment's end ? Please explain all of my question in details if possible.
P/s : Remember that I have 2 questions ...