use max-heap and min-heap to find the median