using a min-heap, a max-heap, and a median variable to implement a data structure to fetch median of a integer stream in O(1) time. of course, it requires additional storage.
c*t
10 楼
if you need maintain heaps, how can dequeue and enqueue be O(1) time?
【在 f*****7 的大作中提到】 : using a min-heap, a max-heap, and a median variable to implement a data : structure to fetch median of a integer stream in O(1) time. of course, it : requires additional storage.