Simple Java Solution with 2 Heaps and Explanation
    class MedianFinder {\n        PriorityQueue<Integer> min = null;\n        PriorityQueue<Integer> max = null;\n        int len = 0;\n        \n        public
        class MedianFinder {\n        PriorityQueue<Integer> min = null;\n        PriorityQueue<Integer> max = null;\n        int len = 0;\n        \n        public MedianFinder(){\n            min = new PriorityQueue<>();\n            max = new PriorityQueue<>(Collections.reverseOrder());\n        }\n        \n        //Understanding is we will be maintain 2 heaps max and min. The max heap will store the smaller half\n        //and the min heap will store the larger half of the incoming numbers. Basically we are trying to mimic a \n        //balanced tree with this model of representation, which means the max heap at the most can have only one extra\n        //element than the min heap. We need to maintain the ordering that the root of the max heap < root of min heap\n        \n        // Adds a number into the data structure.\n        public void addNum(int num) {\n            //if the number of elements is even then we need to add the new element to the max heap\n            if(len%2==0){\n                max.offer(num);\n            }else{\n                //if the number of elements is odd then we need to add the new element to the maxheap\n                //then transfer the root of the max heap to the min heap\n                max.offer(num);\n                min.offer(max.poll());\n            }    \n            \n            //increment the size\n            len++;\n            \n            //if the root of max heap > root of min heap, then it conficts our order rule\n            //so we shift the max heap's root to min heap and add the minimum element of our\n            //min heap to max heap\n            if(len > 1 && max.peek() > min.peek()){\n                min.offer(max.poll());\n                max.offer(min.poll());\n            }\n        }\n    \n        // Returns the median of current data stream\n        public double findMedian() {\n            return (len%2==0)?((double)((max.peek()+min.peek())/2.0)):((double)max.peek());\n        }\n    }
['Heap (Priority Queue)', 'Java']