C# solution with BinarySearch
private List<double> m_listNum = new List<double>();\n    \n    public void AddNum(double num) {\n    \n        int lintPos = m_listNum.BinarySearch( num ) ;\n 
    private List<double> m_listNum = new List<double>();\n    \n    public void AddNum(double num) {\n    \n        int lintPos = m_listNum.BinarySearch( num ) ;\n        if (lintPos >= 0) {\n            m_listNum.Insert(lintPos, num);\n        } else {\n            lintPos = ~lintPos;\n            if (lintPos == m_listNum.Count) {\n                m_listNum.Add(num);\n            } else {\n                m_listNum.Insert(lintPos, num);\n            }\n        }\n    }\n    \n    // return the median of current data stream\n    \n    public double FindMedian() {\n    \n        int lintCount = m_listNum.Count ;\n    \n        if (lintCount == 0 ) throw new Exception("array is empty");\n    \n        if (lintCount % 2 == 0)\n            return (m_listNum[lintCount / 2 - 1] + m_listNum[lintCount / 2]) / 2;\n        else \n            return m_listNum[lintCount / 2];\n    }
['Binary Search']