Solve the rolling median problem using two TreeSet, a O(nlgn) solution.