Create an array created [ ] to keep track of created nodes , initialize all entries as NULL
Node * created [ n ] ; for ( int i = 0 ; i < n ; i ++ ) created [ i ] = NULL ; Node * root = NULL ; for ( int i = 0 ; i < n ; i ++ ) createNode ( parent , i , created , & root ) ; return root ; }