5

Given an array with $n>2$ elements of integer sets intervals, where each set is represented as a tuple of the form $(inf, sup)$ (with $inf $ ínfimum and $sup $ maximum of the set), we want to obtain the two intervals such that the number of elements of the intersection is maximum.

$e.g: A=[(1,2),(1,4),(3,7),(4,7)]$

The maximum intersection is given by the elements $(3,7)$ and $ (4,7) $ with $4$ elements {4,5,6,7}.

The algorithm is required to be implemented using the Divide and Conquer strategy and running in time $O (n\log n) $.

Any ideas?

Yuval Filmus
  • 280,205
  • 27
  • 317
  • 514

0 Answers0