A、A) q↑.rlink:=p; q↑.llink:=p↑.llink; p↑.rlink↑.rlink:=q; p↑.11ink:=q;
B、B) q↑llink:=p; q↑.rlink:=p↑.rlink; p↑rlink↑.llink:=q; p↑rlink:=q;
C、C) p↑.llink↑.rlink:=q; p↑.llink:=q; q↑rlink:=p; q↑.llink:=p↑.llink;
D、D) p↑.rlink↑.llink:=q; p↑.rlink:=q; q↑llink:=p; q↑rlink:=p↑.rlink;
查看答案
正确答案
试题解析
在双链表中,如果要在P所指结点后插入q所指的新结点,只需修改P所指结点的rlink字段和原后继的llink字段,并置q所指结点的llink和rlink值。即q↑.llink:=p;q↑.rlink:=p ↑.rlink;p ↑.rlink ↑.llink:=q;p ↑.rlink:=q。