Two heaps
medium 22 minThe two heaps pattern keeps a max-heap for the smaller half of the values and a min-heap for the larger half.
Explain your choices
Answer first. Then compare your reasoning.
12 questions 0 got it 0 to review12 not marked
The two heaps pattern keeps a max-heap for the smaller half of the values and a min-heap for the larger half.
Answer first. Then compare your reasoning.