Find Median from Data Stream
The median is the middle value in an ordered integer list. Implement the MedianFinder class.
Find Median from Data Stream

The median is the middle value in an ordered integer list. Implement the MedianFinder class.

Example 1:
Input: {"commands":["MedianFinder","addNum","addNum","findMedian","addNum","findMedian"],"values":[[],[1],[2],[],[3],[]]}
Output: [null,null,null,1.5,null,2.0]
Input
arr ={"commands":["MedianFinder","addNum","addNum","findMedian","addNum","findMedian"],"values":[[],[1],[2],[],[3],[]]}

addNum(1)

Max Heap (Left)

Empty

Min Heap (Right)

Empty

Adding: 1

Variables
No variables to display
DepthFunction Call
Stack empty
0/9