)。
A: q->
next = p->next;p->next
= q;
B: p->next
= q->next;q
= p;
C: q->next
= p->next;p
= q;
D: p->next
= q->next;q->next
= p;
举一反三
- 在一个单链表HL为表头指针中,若要在指针q所指的结点的后面插入一个由指针p所指的结点,则执行 ( )。 A: q->next = p->next ; p->next = q; B: p->next = q->next; q = p; C: q->next = p->next; p->next = q; D: p->next = q->next ; q->next = p;
- 在一个双链表中,在P结点之后插入结点q的操作是()。 A: q->prior=p; p->next=q; p->next->prior=q;q->next=p->next; B: q->next=p->next; p->next->prior=q;p->next=q;q->prior=p; C: p->next=q;q->prior=p;q->next=p->next;p->next->prior=q; D: q->prior=p;p->next=q;q->next=p->next;p->next->prior=q;
- 在一个长度为n(n≥1)的双链表中,在p所指节点(非头节点)之前插入q所指节点的操作是( )。 A: p->prior=q; q->next=p; p->prior->next=q; q->prior=p->prior; B: q->prior=p->prior; p->prior->next=q; q->next=p; p->prior=q->next; C: q->next=p; p->next=q; q->prior->next=q; q->next=p; D: p->prior->next=q; q->next=p; q->prior=p->prior; p->prior=q;
- 删除单链表中指针p所指结点的语句序列为( )。 A: q=p->next; p->data=q->data; p->next=q->next; free(q); B: q=p->next; q->data=p->data; p->next=q->next; free(q); C: q=p->next; p->next=q->next; free(q); D: q=p->next; p->data=q->data; free(q);
- 在一个单链表HL中,若要删除由指针q所指向结点的后继结点,则执行的语句是 。 A: p=q->next; p->next=q->next; B: p=q->next; q->next=p; C: p=q->next; q->next=p->next; D: q->next=q->next->next; q->next=q;
内容
- 0
设指针变量p指向单链表中结点A,若删除单链表中结点A,则需要修改指针的操作序列为( )。 A: q=p->next;p->data=q->data;p->next=q->next;free(q) B: q=p->next;q->data=p->data;p->next=q->next;free(q) C: q=p->next;p->next=q->next;free(q) D: q=p->next;p->data=q->data;free(q)
- 1
两个指针变量p和q,分别指向单链表的两个结点,p所指结点是q所指结点的前一个结点的条件是()。 A: p->next==q->next B: p->next==q C: q->next==p D: p==q
- 2
在一单链表中,删除指针p所指的后继结点,以下语句正确的是() A: p=p-> next; B: s=p-> next;p-> next=s- <br/>>next;free (s) ; C: free (p-> next) ;p- <br/>>next=p-> next-> next; D: p-> next=p-> next- <br/>>next; free (p-> next) ;
- 3
两个指针P和Q,分别指向单链表的两个元素,P所指元素是Q所指元素前驱的条件是( )。 A: P->next==Q->next B: P->next==Q C: Q->next==P D: P==Q
- 4
在一个单链表中,已知 q 是 p 的前趋结点,若在 q 和 p 之间插入结点 s ,则应当执行语句序列( )。 A: s -> next = p -> next; p -> next = s; B: s -> next = q -> next; p -> next = s; C: s -> next = q -> next; q -> next = s; D: q -> next = s; s -> next = p;