JAVA SOLUTION || BFS   
Code
# Code
```java []
 
class FindElements {
    HashSet<Integer> hm=new HashSet<>();
    public FindElements(TreeNode root) {
        root.val=0;
        Queue<TreeNode> q=new LinkedList<>();
        q.add(root);
        hm.add(0);
        while(!q.isEmpty())
        {
            TreeNode node=q.remove();
            if(node.left!=null)
            {
                node.left.val=2*node.val+1;
                hm.add(node.left.val);
                q.add(node.left);
            }
            if(node.right!=null)
            {
                node.right.val=2*node.val+2;
                hm.add(node.right.val);
                q.add(node.right);
            }

        }
    }
    
    public boolean find(int target) {
        return hm.contains(target);
    }
}

```
['Java']