segment tree or interval tree to deal with the problem for example the interval statistical problem...