My C++ priority_queue based solution (140 ms)
The idea is to use two heaps  (one max heap, one mn heap) to save the input data. firstQ is a max_heap to save the first half of the data with smaller values,  
The idea is to use two heaps  (one max heap, one mn heap) to save the input data. firstQ is a max_heap to save the first half of the data with smaller values,  and secQ is a min_heap to save the second half of the data with bigger values. Everytime when inserting a new value, we first compare if it is smaller than the top of firstQ (the largest value of the first half), if so, insert into firstQ. Otherwise, it belongs to the second half.  After inserting, we have to balance the first half and the second half to make sure either they have the same length or the length difference is only 1. \nThe median will be the mean of two top elements (when they have the same length) or the top element of the queue with a larger length. \n\n    class MedianFinder {\n    private:\n        priority_queue<int> firstQ; // max_heap for the first half\n        priority_queue<int, std::vector<int>, std::greater<int> > secQ; // min_heap for the second half\n    public:\n        // Adds a number into the data structure.\n        void addNum(int num) {\n            if(firstQ.empty() || (firstQ.top()>num)) firstQ.push(num); // if it belongs to the smaller half\n            else secQ.push(num); \n            \n            // rebalance the two halfs to make sure the length difference is no larger than 1\n            if(firstQ.size() > (secQ.size()+1))\n            {\n                secQ.push(firstQ.top());\n                firstQ.pop();\n            }\n            else if(firstQ.size()+1<secQ.size())\n            {\n                firstQ.push(secQ.top());\n                secQ.pop();\n            }\n        }\n    \n        // Returns the median of current data stream\n        double findMedian() {\n            if(firstQ.size() == secQ.size()) return firstQ.empty()?0:( (firstQ.top()+secQ.top())/2.0);\n            else return (firstQ.size() > secQ.size())? firstQ.top():secQ.top(); \n        }\n    };
[]