An interval graph is defined by a finite and non-empty intervals on the real axis. For each interval we have a peak interval graph and two vertices are adjacent if their corresponding intervals have non-empty intersection.
Describe an algorithm that receives input n intervals (closed) with extremities integers in the range [1 .. 2n] determine in O(n) connected components of the graph interval defined by them.