Algorithm
-
[Algorithm, PS] Getting the nearest segment on a line in O(log N), minimum distances between segments (+ Python Code)PS 2022. 10. 15. 12:30
Problem Statement: There are N segments on a line. Each segment is characterized by two integers l, r, where l and r are the starting and ending coordinates of each segment. Given an specific coordinate x, print the distance between the nearest segment from x and x. distance between a segment and x means the minimuim distance between any points on a segment and x.) If we were to find the solutio..