C++ BFS
\nclass Solution {\npublic:\n    vector<TreeNode*> delNodes(TreeNode* root, vector<int>& to_delete) {\n        queue<TreeNode*> nodesQ;\n        vector<TreeNode
```\nclass Solution {\npublic:\n    vector<TreeNode*> delNodes(TreeNode* root, vector<int>& to_delete) {\n        queue<TreeNode*> nodesQ;\n        vector<TreeNode*> result;\n        nodesQ.push(root);\n        if (!root) {\n            return result;   \n        }\n        unordered_set<int> deleted(to_delete.begin(), to_delete.end());\n        if (deleted.find(root->val) == deleted.end()) {\n            result.push_back(root);\n        }\n        while (!nodesQ.empty()) {\n            TreeNode* cur = nodesQ.front();\n            nodesQ.pop();\n            if (cur->left) {\n                nodesQ.push(cur->left);\n                if (deleted.find(cur->left->val) != deleted.end()) {\n                    cur->left = NULL;\n                } else {\n                    // If our parent is deleted\n                    if (deleted.find(cur->val) != deleted.end()) {\n                        result.push_back(cur->left);\n                    }\n                }\n            }\n            if (cur->right) {\n                nodesQ.push(cur->right);\n                if (deleted.find(cur->right->val) != deleted.end()) {\n                    cur->right = NULL;\n                } else {\n                    // If our parent is deleted\n                    if (deleted.find(cur->val) != deleted.end()) {\n                        result.push_back(cur->right);\n                    }\n                }\n            }\n        }\n        return result;\n    }\n};\n```
['Breadth-First Search', 'C']