Given are pairs of integers (a1,b1),...,(an,bn)
. Pair i
is "dominated" by pair j
if ai < aj
and bi < bj
. What is an algorithm to quickly determine the list of pairs that are not dominated by any other pair?
We can check all the pairs, and for each pair, check whether it is dominated by any other pair by going through all the pairs again. This algorithm is order n^2
. Is there an algorithm of order n
or n log n
?