I'm having a hard time designing an algorithm to compute a union of a bunch of sets on closed intervals.
For example if you have sets like these:
[5,10] [2.2,3] [1,2] [3.1,7] [1.5,2.5], the algorithm should return [1,3] [3.1,10].

Also how would you merge x number of linked lists (already sorted) into one (also sorted) linked list.

In both cases I'm looking for as efficient design as possible.

Thanks
Q