(1)P->next=P->next->next;(10) P->prior->next=P (2)P->prior=-P->prior->prior;(11) P->next->prior=P (3)P->next=S (12)P->next->prior=s (4)P->prior=S (13) P->prior->next=S (5S->next=P (14)P->next->prior=P->prior (6)S→> prior=P; (15)Q=P->next (7)S->next= P->next (16)Q=P→> prior; (8)S>prior= P->prior (17)free (P) (9)p->prior->next=p->next:(18 free(Q) 解答: a.(12)(7)(3)(6)3必须在12和7的后面,其余的顺序可变 b.(13)(8)(4)(5)同上 C.(15)(1)(11)(18)不可变 d.(16)(2)(10)(18)不可变 e.(9)(14)(17)
6 (1)P->next=P->next->next; (10) P->prior->next=P; (2)P->prior=P->prior->prior; (11) P->next->prior =P; (3) P->next=S; (12)P->next->prior=S; (4) P->prior=S; (13) P->prior->next=S; (5)S->next=P; (14) P->next->prior=P->prior (6)S->prior=P; (15)Q=P->next; (7) S->next= P->next; (16)Q= P->prior; (8) S->prior= P->prior; (17)free(P); (9) P->prior->next=p->next; (18)free(Q); 解答: a.(12)(7)(3)(6) 3必须在12和7的后面,其余的顺序可变 b.(13)(8)(4)(5) 同上 c.(15)(1)(11)(18) 不可变 d.(16)(2)(10)(18) 不可变 e.(9)(14)(17)
2.4静态链表 静态链表:在数组中增加一个(或两个)指针 域,这些指针域用来存放下一个(或上一个) 数据元素在数组中的下标,从而构成用数组 构造的单链表(或双链表)。静态链表中的 指针又称仿真指针
7 2.4 静态链表 静态链表:在数组中增加一个(或两个)指针 域,这些指针域用来存放下一个(或上一个) 数据元素在数组中的下标,从而构成用数组 构造的单链表(或双链表)。静态链表中的 指针又称仿真指针