C# PriorityQueue solution
Approach\n\n1. Enqueue each element to min heap \n2. Dequeue element from min heap and enqueue to max heap -> This will ensure all elements in min heap > max he
Approach\n\n1. Enqueue each element to min heap \n2. Dequeue element from min heap and enqueue to max heap -> This will ensure all elements in min heap > max heap\n3. Balance 2 heaps - when min heap size < max heap size then dequeue element from max heap and enqueue in min heap\n\n\n```\n    public class MedianFinder\n    {\n\n        private PriorityQueue<int, int> _minHeap;\n        private PriorityQueue<int, int> _maxHeap;\n\n        public MedianFinder()\n        {\n            _minHeap = new PriorityQueue<int, int>();\n            _maxHeap = new PriorityQueue<int, int>(Comparer<int>.Create((a,b) => b.CompareTo(a)));\n        }\n\n        public void AddNum(int num)\n        {\n            _minHeap.Enqueue(num, num);\n            int minHeapPeek = _minHeap.Dequeue();\n            _maxHeap.Enqueue(minHeapPeek, minHeapPeek);\n            if (_minHeap.Count < _maxHeap.Count)\n            {\n                int maxheapPeek = _maxHeap.Dequeue();\n                _minHeap.Enqueue(maxheapPeek, maxheapPeek);\n            }\n        }\n\n        public double FindMedian()\n        {\n            return _minHeap.Count > _maxHeap.Count ? \n                _minHeap.Peek() : \n                (_minHeap.Peek() + _maxHeap.Peek()) / 2.0;\n        }\n    }\n```
['Heap (Priority Queue)']