```
import bisect
class MedianFinder:
def __init__(self):
"""
Initialize your data structure here.
"""
self.data = []
def addNum(self, num):
"""
Adds a num into the data structure.
:type num: int
:rtype: void
"""
bisect.insort(self.data, num)
def findMedian(self):
"""
Returns the median of current data stream
:rtype: float
"""
if len(self.data) == 1:
return self.data[0]
if len(self.data) % 2 == 0:
return (self.data[len(self.data)/2] + self.data[len(self.data)/2-1]) / 2.0
else:
return self.data[len(self.data)/2]
```