C++ Normal Binary Search Approach
Binary Searrch to Find the Index where the num to be fitted.\n\nclass MedianFinder {\npublic:\n    /** initialize your data structure here. */\n    MedianFinder
Binary Searrch to Find the Index where the num to be fitted.\n```\nclass MedianFinder {\npublic:\n    /** initialize your data structure here. */\n    MedianFinder() {\n        \n    }\n    vector<int> ans;\n    void addNum(int n) {\n        if(ans.size()==0) ans.push_back(n);\n        \n        else{\n          int l=0, r=ans.size()-1;\n            int mid;\n            while(l<=r){\n                mid=l+(r-l)/2;\n                if(ans[mid]<n)l=mid+1;\n                else{\n                    r=mid-1;\n                }\n            }\n            ans.insert(ans.begin()+l,n);\n            \n        }\n    }\n    \n    double findMedian() {\n         int n=ans.size();\n       \n        if(n%2){\n            return  ans[n/2];\n        }\n        \n        else{\n            return double((ans[n/2]+ans[(n/2)-1])/2.00000);\n        }\n    }\n};\n\n```
['C', 'Binary Tree']