simple and easy C++ solution || BSF
\n# if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n###### Let\'s Connect on Linkedin: www.linkedin.com/in/shishirrsiam\n\n\n\n\n# Code\ncpp []\nclass Solut
\n# if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n###### Let\'s Connect on Linkedin: www.linkedin.com/in/shishirrsiam\n\n\n\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    void help(TreeNode* root, unordered_map<int, set<int>>&store)\n    {\n        queue<TreeNode*>q;\n        if(root) \n        {\n            store[root->val].insert(-1);\n            q.push(root);\n        }\n        while(!q.empty())\n        {\n            int size = q.size();\n            while(size--)\n            {\n                auto node = q.front(); q.pop();\n                if(node->left) \n                {\n                    store[node->val].insert(node->left->val);\n                    q.push(node->left);\n                }\n                if(node->right) \n                {\n                    store[node->val].insert(node->right->val);\n                    q.push(node->right);\n                }\n            }\n        }\n    }\n    bool flipEquiv(TreeNode* root1, TreeNode* root2) \n    {\n        unordered_map<int, set<int>>store1, store2;\n        help(root1, store1);\n        help(root2, store2);\n\n        return store1 == store2;\n    }\n};\n```
['Hash Table', 'Tree', 'Depth-First Search', 'Breadth-First Search', 'Binary Tree', 'C++']