A: s->prior=p; s->next=p->next; p->next=s; p->next->prior=s;
B: p->next=s; p->next->prior=s; s->prior=p; s->next=p->next;
C: p->next=s; s->prior=p; p->next->prior=s; s->next=p->next;
D: s->prior=p; s->next=p->next; p->next->prior=s; p->next=s;
举一反三
- 在循环双链表的P所指节点之后插入s所指节点的操作是( ) A: p->next=s; s->prior=p; p->next->prior=s; s->next=p->next; B: p->next=s; p->next->prior=s; s->prior=p; s->next=p->next; C: s->prior=p; s->next=p->next; p->next=s; p->next->prior=s; D: s->prior=p; s->next=p->next; p->next=s;p->next->prior=s;
- 设指针变量p指向双向链表中结点A,指针变量s指向被插入的结点X,则在结点A的后面插入结点X的操作序列为()。 A: p->next=s;s->prior=p;p->next->prior=s;s->next=p->next; B: s->prior=p;s->next=p->next;p->next=s;p->next->prior=s; C: p->next=s;p->next->prior=s;s->prior=p;s->next=p->next; D: s->prior=p;s->next=p->next;p->next->prior=s;p->next=s;
- 在循环双链表的p所指的结点之前插入s所指结点的操作是 ( ) A: p->;prior = s;s->;next = p;p->;prior->;next = s;s->;prior = p->;prior; B: p->;prior = s;p->;prior->;next = s;s->;next = p;s->;prior = p->;prior; C: s->;next = p;s->;prior = p->;prior;p->;prior = s;p->;prior->;next = s; D: s->;next = p;s->;prior = p->;prior;p->;prior->;next = s;p->;prior = s;
- 在循环双链表的p所指结点之后插入s结点的操作是( ) A: p->next=s; s->pre=p; p->next->pre=s; s->next=p->next; B: p->next=s; p->next->pre=s; s->pre=p; s->next=p->next; C: s->pre=p; s->next=p->next; p->next->pre=s; p->next=s; D: s->pre=p; s->next=p->next; p->next=s; p->next->pre=s;
- 在一个双链表中,在* $p$ 结点之后插入一个结点*s 的操作是[input=type:blank,size:4][/input]。 A: s-> prior =p ; p->n e x t=s ; p-> next -> prior =s ; s->n e x t=p-> next s -> next = p -> next ; B: p -> next -> prior = s ; p -> next = s ; s \rightarrow> prior = p C: p -> next = s ; s \rightarrow> prior = p ; s -> next = p -> next ; p -> next -> prior = s ; D: p -> next -> prior = s ; s -> next = p -> next ; s \rightarrow prior = p ; p -> next = s
内容
- 0
在单链表中,若*p结点不是终端结点,在其后插入*s结点的操作是 。 A: s->next = p; p->next = s; B: s->next = p->next; p->next = s; C: s->next = p->next; p = s; D: p->next = s; s->next = p;
- 1
在单链表中,要将s所指结点插入到p所指结点之后,其语句为() A: s->next =p+1; p->next=s; B: (*p).next=s;(*s).next=(*p).next; C: s->next = p->next; p->next=s; D: s->next = p->next; p->next=s->next;
- 2
在一个单链表中,若p所指节点不是最后节点,在p之后插入s所指节点,则执行()。 A: s->next=p;p->next=s; B: s->next=p->next;p->next=s; C: s->next=p->next;p=s; D: p->next=s;s->next=p;
- 3
在一个不带头结点的单链表中,若 p 所指结点不是最后结点,在 p 之后插入 s 所指结点,则执行()。 A: s->next=p;p->next=s; B: s->next=p->next;p=s; C: s->next=p->next;p->next=s; D: p->next=s;s->next=p->next;
- 4
若已建立下面的链表结构,指针p,s分别指向图中所示结点,则不能将s所指的结点插入到链表末尾的语句组是()。 A: s->next=NULL; p=p->next; p->next=s; B: p=p->next; s->next=p->next; p->next=s; C: p=p->next; s->next=p; p->next=s; D: p=(*p).next; (*s).next=(*p).next; (*p).next=s;