Populate Inorder Successor for all nodes

void InOrder(Node *pNode)
{
    static Node *pPreNode = NULL;
    
    if (!Node)
        return;

    InOrder(pNode->left);

    if (pPreNode != NULL)
        pPreNode->next = pNode;
    
    InOrder(pNode->right)

    pPreNode = pNode;
}

你可能感兴趣的:(Populate Inorder Successor for all nodes)