C++ easy | minheap maxheap | (hindi comments)
\nclass MedianFinder {\nprivate:\n    priority_queue<int> maxpart;                           //isme sab choto ka descending order rehta\n    priority_queue<int,
```\nclass MedianFinder {\nprivate:\n    priority_queue<int> maxpart;                           //isme sab choto ka descending order rehta\n    priority_queue<int, vector<int>, greater<int>> minpart;    //isme sab bade bhaiyo ka ascending order rehta\npublic:\n    MedianFinder() {\n        \n    }\n    \n    void addNum(int num) {         \n        maxpart.push(num);              // maxpart mey num jaata, waha sort hojata. \n        minpart.push(maxpart.top());    //Phir, maxpart ke top (largest) ku min part mey daalrai\n        maxpart.pop();                  //bade bhai ku maxpart se nikaaldo    -> min mey neeche chalejaata \n        if(maxpart.size() < minpart.size()){     //agar bade bhailog zyada hogaye minpart mey \n            maxpart.push(minpart.top());        //toh unmese sabse chote bade bhai ku choto mey daaldo\n            minpart.pop();                      //nikaaldo usku phir\n        }\n    }\n    \n    double findMedian() {\n        if(maxpart.size() > minpart.size()) //odd number length hai toh hota, aur humesha maxpart(chote\'s desc.order) ku bada rakhrai\n            return maxpart.top();   //odd length aaya toh odd one out apne choto mey se rehta, unka sabse bada wala apna banda \n        return (maxpart.top()+minpart.top())/2.0;    //even length aaya toh, choto ke bade aur bado ke chote ka avg hai ans\n    }\n};\n\n```
['Binary Search Tree', 'C', 'Heap (Priority Queue)', 'C++']