A simple accepted solution
void connect(TreeLinkNode *root) {\n        if (root == NULL) return;\n        TreeLinkNode *pre = root;\n        TreeLinkNode *cur = NULL;\n        while(pre->
    void connect(TreeLinkNode *root) {\n        if (root == NULL) return;\n        TreeLinkNode *pre = root;\n        TreeLinkNode *cur = NULL;\n        while(pre->left) {\n            cur = pre;\n            while(cur) {\n                cur->left->next = cur->right;\n                if(cur->next) cur->right->next = cur->next->left;\n                cur = cur->next;\n            }\n            pre = pre->left;\n        }\n    }\nyou need two additional pointer.
[]