Geometric Algorithms for Intervals and Related Problems