Python solution using Binary Search
class MedianFinder:\n        def __init__(self):\n            """\n            Initialize your data structure here.\n            """\n            self.ref_array
    class MedianFinder:\n        def __init__(self):\n            """\n            Initialize your data structure here.\n            """\n            self.ref_array = []\n            self.length = 0\n            \n        def addNum(self, num):\n            """\n            Adds a num into the data structure.\n            :type num: int\n            :rtype: void\n            """\n            # keep a sorted array\n            # use binary search to find insertion index\n            \n            low = 0\n            high = self.length - 1\n            \n            while low <= high:\n                mid = (low+high)//2\n                if self.ref_array[mid] >= num:\n                    high = mid - 1\n                else:\n                    low = mid + 1\n                    \n            self.ref_array.insert(low,num)\n            self.length += 1\n                \n    \n        def findMedian(self):\n            """\n            Returns the median of current data stream\n            :rtype: float\n            """\n            # as array is always sorted we can always use the same median property\n            \n            if self.length % 2 == 0:\n                temp = self.length // 2\n                return (self.ref_array[temp]+self.ref_array[temp-1])/2.0\n            else:\n                return self.ref_array[self.length // 2]
['Binary Tree', 'Python']