正在加载图片...
q->exp-r; q->coef=x free(hp); return h. 其中的 reverse函数说明如下 mulpoly*q f mulpoly *pl, *p2 if(q=null) i pl=q->next; q->next=null while(pll=null) f p2=pI->next; 多项式的输出的输出,实际上就是单链表的输出,只是该单链表的数据 域含有系数和指示两部分而已。 /*多项式的输出 playout(head) mulpoly * head t mulloy *p, *q p=head->next while(pl=NULL) p->coef p=p->next;q->exp=r; q->coef=x; q→next=null; hp->next=q; hp=q; } } /* end of for hp=h; h=h->next; free(hp); return h; } 其中的 reverse 函数说明如下 reverse(q) mulpoly *q; { mulpoly *p1, *p2; if(q!=null) { p1=q->next; q->next=null; while(p1!=null) { p2=p1->next; p1->next=q; q=p1; p1=p2; } } 多项式的输出的输出,实际上就是单链表的输出,只是该单链表的数据 域含有系数和指示两部分而已。 /*多项式的输出 ployout(head) mulpoly *head; { mulploy *p , *q ; p=head->next; while(p!=NULL) { printf(“%d,%d”,p->coef,p->exp); p=p->next; } }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有