循环链表为什么会有为空的条件
void LatinSquare(LNode *head, int n)//拉丁方阵
{
LNode *p;
//p = head;
for (int i = 1; i <= n; i++)
{
p = head;
for (int j = 1; j < i; j++)
{
p = p->next;
}
for (int m = 1; m <= n&&p->next ==NULL; m++)//循环链表会为空?p->next ==NULL
{
printf("%4d", p->data);
p = p->next;
}
printf("\n");
}
}
页:
[1]