一元稀疏多项式以循环单链表按降幂排列结点有三个域系数域coef 指数域exp和指针域 next现对链表求一阶导数 链表的头指针为ha头结点的exp域为 –
derivative(ha)
{ q=ha ; pa=ha>next;
while( () )
{ if ( () ) { ( () ); free(pa); pa= ( () ); }
else{ pa>coef ( () ); pa>exp( () ); q=( () );}
pa=( () );
}
} 【南京理工大学 三(分)】
下面是删除单链表L中最大元素所在结点的类PASCAL语言算法请在横线填上内容完成其功能
TYPE pointer =↑node
node=RECORD
data:integer; next: pointer
END;
PROCEDURE delmax (L:pointer);
VAR pqr:pointer; m:integer;
BEGIN
r:=L p:=L↑next;
IF p<>NIL THEN
[ m:=p↑data; () ; p:=p↑next;
WHILE p<>NIL DO
[ IF () THEN [ () ; m:=p↑data; ]
() ; p:=p↑next;
]
q:=r↑next; () ; dispose(q);
]
END;【北京科技大学 二】
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []