链表的多项式重新表达 [英] Polynomial represntation of linked list

查看:50
本文介绍了链表的多项式重新表达的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用符号函数来确定输入的多项式的符号。



我尝试过:



how to use a sign function for deciding the sign of the polynomial entered.

What I have tried:

void polynomial_add (struct polynomial *node)
{
struct polynomial *ptr;
while(node->next !=NULL)
{
ptr = node->next;
if( node->exp == ptr->exp)
{
node->cof = node->cof + ptr->cof;
node->next = ptr->next;
ptr->next = NULL;
free(ptr);
}
else
node = node->next;
}
}

推荐答案

看起来你没有在你的任务中投入大量的efford。文章如何使用C / C ++创建链接列表将向您展示如何处理简单的家庭作业。
Looks like you havent put a lot of efford in your task. The article How to create Linked list using C/C++ will show you how to deal with your simple homework.


这篇关于链表的多项式重新表达的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆