Easy C++ Solution using HashMap
\nclass FindElements\n{\npublic:\n    unordered_map<int,int>m;\n\n    FindElements(TreeNode* root)\n    {\n        if(root)\n        {\n            root->val = 
```\nclass FindElements\n{\npublic:\n    unordered_map<int,int>m;\n\n    FindElements(TreeNode* root)\n    {\n        if(root)\n        {\n            root->val = 0;\n            queue<TreeNode*> q;\n            q.push(root);\n            m[0]++;\n\n            while(!q.empty())\n            {\n                TreeNode* temp = q.front();\n                q.pop();\n                int x = temp->val;\n                if(temp->left)\n                {\n                    temp->left->val = x*2 + 1;\n\n                    m[x*2 + 1]++;\n                    q.push(temp->left);\n                }\n\n                if(temp->right)\n                {\n                    temp->right->val = x*2 + 2;\n\n                    m[x*2 + 2]++;\n                    q.push(temp->right);\n                }\n            }\n        }\n    }\n\n    bool find(int target)\n    {\n        return (m.find(target) != m.end());\n    }\n};\n```
['Breadth-First Search', 'C']