Back to Question

Design a Data Stream Median Finder

Question Explain

Design a data structure that supports adding integers from a data stream and finding the median of all elements added so far. Use two heaps (Max-Heap for the lower half, Min-Heap for the upper half).

Start Trying This Question Simulation

Click "Start Speaking" and answer the question naturally.