Very easy BFS Solution C++ | Hint for constant Space
Hint for constant space -> is to use the next links that you just created \n\nclass Solution {\npublic:\n    Node* connect(Node* root) {\n        if(root == NUL
Hint for constant space -> is to use the next links that you just created \n```\nclass Solution {\npublic:\n    Node* connect(Node* root) {\n        if(root == NULL) return root;\n        queue<Node*> q;\n        q.push(root);\n        while(!q.empty()){\n            int n=q.size();\n            int j=0;\n            for(int i=0;i<n;i++){\n                Node* node = q.front();\n                q.pop();\n                j++;\n                if(j<n){\n                    Node* x = q.front();\n                    node->next = x;\n                }else{\n                    node->next = NULL;\n                }\n                if(node->left) q.push(node->left);\n                if(node->right) q.push(node->right);\n                \n            }\n        }\n        return root;\n    }\n};\n```
['Breadth-First Search', 'C']