C++ recursive solution
\n    void connect(TreeLinkNode *root) {\n        if(!root) return;\n        if(root->left){\n            root->left->next = root->right;\n            root->rig
```\n    void connect(TreeLinkNode *root) {\n        if(!root) return;\n        if(root->left){\n            root->left->next = root->right;\n            root->right->next = root->next? root->next->left : NULL;\n        }\n        connect(root->left);\n        connect(root->right);\n    }\n```
[]