现有以下结构体说明和变量定义,如图所示,指针p、q、r分别指定一个链表中连续的3个结点。
A.q->;next=r->;next;p->;next=r;r——>;next=q;
B.Q->;next=r;q->;next=r->;next;r——>;next=q;
C.Q->;next=r->;next;r->;next=q;p——>;next=r;
D.qnext=q;p->;next=r;q->;next=r->;next;
第1题:
现有以下结构体说明和变量定义,如图所示,指针p、q、r分别指向—个链表中连续的三个结点。 street node { char data; struct node *next; } *p,*q,*r;
现要将q和r所指结点交换前后位置,同时要保持链表的连续,以下不能完成此操作的语句是______。
A.q->next=r->next; p->next=r,r->next=q;
B.p->next=r,q->next=r->next;r->next=q;
C.q->next=r->next;r->next=q;p->next=r,
D.r->next=q;P->next=r;q->next=r->next;
第2题:
现有以下结构体说明和变量定义,如图所示,指针P,q,r分别指向一个链表中连续的三个结点。
struct node { char data; struct node *next; } *p,*q,*r; 现要将q和r所指结点交换前后位置,同时要保持链表的连续,以下不能完成此操作的语句是( )。
A.q->next=r->next;p->next=r;r->next=q;
B.p->next=r;q->next=r->next;r->next=q;
C.q->next=r->next;r->next=q;p->next=r;
D.r->next=q;P->next=r;q->next=r->next;
第3题:
现有以下结构体说明和变量定义,如图所示,指针P、q、r分别指定一个链表中连续的3个结点。
struct node
{har data;
struct node*next;)*P,*q,*r;
现要将q和r所指结点交换前后位置,同时要保持链表的结构,下列不能完成此操作的语句是( )。
A.q-:>next=r->next;p--:>next=r;rm:>next=q;
B.q-:>next=r;q->next=r->next;r->next=q;
C.q-:>next=r->next;r->next=q;p->next=r;
D.q-:>next=q;p->next=r;q->next=r->next;
第4题:
现有以下结构体说明和变量定义,如图所示,指针p、q、r分别指定一个链表中连续的3个结点。struct node {bar data; struct node*next;}*p,*q,*r; 现要将q和r所指结点交换前后位置,同时要保持链表的结构,下列不能完成此操作的语句是( )。
A.q->next=r->next;P >next=r;r- >next =q;
B.q->next=r;q->next=r->next;r->next=q;
C.q->next=r->next;r->next=q;P->next=r:
D.q->next=q;P->next=r;q->next=r-> next;
第5题:
有以下结构体说明和变量定义,如图所示,指针p、 q、 r分别指向一个链表中的三个连续结点。 struct node int data; struct node *next; } *p, *q,
*r;现要将q和r所指结点的先后位置交换,同时要保持链表的连续,以下错误的程序是
A.r->next=q; q->next=r->next; p->next=r;
B.q->next=r->next; p->next=r; r->next=q;
C.p->next=r; q->next=r->next; r->next=q;
D.q->next=r->next; r->next=q; p->next=r;