在线题库
[单选]
27、若有以下定义:
struct node
{ int data;
struct node *next;
} *p,*q,*t;
指针p、t和q分别指向图中所示结点:
p t q
↓ ↓ ↓
┌──┬──┐ ┌──┬──┐ ┌──┬──┐
│data│next┼→│data│next┼→│data│next┼→...
└──┴──┘ └──┴──┘ └──┴──┘
现要将t和q所指结点的先后位置交换,同时要保持链表的连续,以下错误的程序段是( )
发布时间:2022-09-12
0次
t->next=q->next;p->next=q;q->next=t;
p->next=q;t->next=q->next;q->next=t;
q->next=t;t->next=q->next;p->next=q;
t->next=q->next;q->next=t;p->next=q;