Print? Node * create ()
{
Int n = 20;
Node * pNew, * pTail, * pHead;
PHead = (Node *) malloc (sizeof (Node ));
PHead-> next = pHead; // empty linked list points to itself
PTail = pHead; // The pTail Pointer Points to the pHead node.
For (int I = 1; I <= n; I ++)
{
PNew = (Node *) malloc (sizeof (Node ));
If (pNew = NULL)
{
Printf ("error !! ");
Exit (0 );
}
PNew-> data = I;
If (pHead-> next = pHead) // empty linked list
{
PHead-> next = pNew;
PTail = pNew; // pTail points to the newly added Node
} Else {// when the table is not empty
PTail-> next = pNew;
PTail = pNew;
}
}
PTail-> next = pHead; // after adding the pointer, point the pointer field of the tail pointer to the header node.
Return pTail;
}
Node * create ()
{
Int n = 20;
Node * pNew, * pTail, * pHead;
PHead = (Node *) malloc (sizeof (Node ));
PHead-> next = pHead; // empty linked list points to itself
PTail = pHead; // The pTail Pointer Points to the pHead node.
For (int I = 1; I <= n; I ++)
{
PNew = (Node *) malloc (sizeof (Node ));
If (pNew = NULL)
{
Printf ("error !! ");
Exit (0 );
}
PNew-> data = I;
If (pHead-> next = pHead) // empty linked list
{
PHead-> next = pNew;
PTail = pNew; // pTail points to the newly added Node
} Else {// when the table is not empty
PTail-> next = pNew;
PTail = pNew;
}
}
PTail-> next = pHead; // after adding the pointer, point the pointer field of the tail pointer to the header node.
Return pTail;
}