.设 q:=p^llink; 则
q^rlink:=p^rlink; p^rlink^llink:=q; p^llink:=q^llink;
q^llink^rlink:=p; p^rlink:=q; q^llink:=p
()前两个语句改为
pllink^rlink< p^rlink;
p^rlink^llink< p^llink;
()后三个语句序列应改为
q^rlink< p^rlink;∥以下三句的顺序不能变
p^rlink^llink< q;
p^rlink< q;
.mp是一个过程其内嵌套有过程subp
subp(sq)的作用是构造从s到q的循环链表
subp(papb)调用结果是将pa到pb的前驱构造为循环链表
subp(pbpa)调用结果是将pb到pa的前驱(指在L链表中并非刚构造的pa循环链表中)构造为循环链表
总之两次调用将L循环链表分解为两个第一个循环链表包含从pa到pb的前驱L中除刚构造的pa到pb前驱外的结点形成第二个循环链表
.在指针p所指结点前插入结点s的语句如下
s>pre=p>pre; s>next=p; p>pre>next=s; p>pre=s;
.(A) f<>NIL并且f<>NIL
(B) f↑data < f↑data
(C) f↑data<f↑data
(D) f↑data<f↑data
(E) f< f↑link 或f=f↑link;
)本算法功能是将双向循环链表结点的数据域按值自小到大排序成为非递减(可能包括数据域值相等的结点)有序双向循环链表
)()r>prior=q>prior;∥将q结点摘下以便插入到适当位置
()p>next>prior=q;∥()()将q结点插入
()p>next=q;
()r=r>next;或r=q>next;∥后移指针再将新结点插入到适当位置
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []