public double findMedian() {
        if (minQ.size() == 0 && maxQ.size() == 0)
            return 0;
        if (minQ.size() == maxQ.size())
            return (double) (minQ.peek() + maxQ.peek()) / 2;
        else {
            return minQ.size() > maxQ.size() ? minQ.peek() : maxQ.peek();
        }
    }