c++
\nclass Solution {\npublic:\n    int res=0;\n    void fun(TreeNode* root, int low, int high){\n        if(root==NULL){\n            return;\n        }\n        
```\nclass Solution {\npublic:\n    int res=0;\n    void fun(TreeNode* root, int low, int high){\n        if(root==NULL){\n            return;\n        }\n        if(root->val<low){\n            fun(root->right,low, high);\n        }\n        if(root->val>=low && root->val<=high){\n            res+=root->val;\n            fun(root->left,low, high);\n            fun(root->right,low, high);\n        }\n        if(root->val>high){\n            fun(root->left,low, high);\n        }\n    }\n    int rangeSumBST(TreeNode* root, int low, int high) {\n        fun(root, low, high);\n        return res;\n    }\n};\n```
['Recursion', 'C', 'Binary Tree']