数据结构课程设计-多元多项式与链表(Data structure curriculum design - multivariate polynomial and linked list).docVIP
- 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
数据结构课程设计-多元多项式与链表(Data structure curriculum design - multivariate polynomial and linked list) * 1. receive a polynomial of three variables (x, y, z) from the user 2. output such polynomials 3. add two such polynomials together 4. multiply two such polynomials 5. the value of the polynomial is computed for a given x, y, and Z values Test data: 2xyz+3x^2y^3z 5x^2y^4z^2-4xyz * / #include stdio.h #include malloc.h #include stdlib.h #include math.h Const int max=10000; Typedef int Status; Typedef struct LNode{ Int coef; / / coefficient Int x, y, Z; / / X respectively, y, Z index LNode *next; }LinkList; / / create polynomial list and store, polynomial into the list LinkList *CreateLink (char, str[max]) { LinkList, *L, *p, *q; L= (LinkList*) malloc (sizeof (LNode)); P=L; Int, i=0, j; Char s[100]={0}; While (str[i], =\0) { If (str[i]==x) { Q= (LinkList*) malloc (sizeof (LNode)); Int, n=0, sum=0; //n for counting, and sum for representing coefficients Int k=i; For (j=0; j=i, k0; j++) {/ / digital storage to the array of s characters If (str[k-1]=0str[k-1]=9) { S[n]=str[k-1]; N++; k--; } Else Break; } For (j=0; jn; j++) {/ / digital characters into corresponding digital Sum+= (s[j]-0) *pow (10, J); } If (n==0) {/ / when x number is not in front of If (i==1str[i-1]==-||str[i-1]==-) / / if x is in the second place, there are negative surface front coefficient is -1 Q-coef=-1; Else Q-coef=1; } Else if (str[k-1]==+||str[k-1]==-||k=0) { If (str[k-1]==-) Q-coef= (sum-2*sum); Else Q-coef=sum; } } Else if (str[i]==y) { Int, n=0, sum=0; //n is used for counting, and sum is used to represent the exponent of X Int k=i; For (j=0; j=i, k0; j++) {/ / digital storage to the array of s characters If (str[k-1]=0str[k-1]=9) { S[n]=str[k-1]; N++; k--; } Else Break; } For (j=0; jn; j++) {/ / digital characters into corresponding digital Sum+= (s[j]-0) *pow (10, J); } If (n==0) Q-x=1; Else if (str[k-1]==^) Q-x=sum; } Else if (str[i]==z) { Int, n=0, sum=0; //n is used for counting, and sum is used
您可能关注的文档
- 5定价策略(5 pricing strategy).doc
- 5年网编经验第一次晒简历(5 years of experience in network editing first sun resume).doc
- 5种家装防水吊顶面板的特点(5 types of home improvement waterproof ceiling panels features).doc
- 006_地狱观(006_ hell view).doc
- 5种中草药水提取液对灵芝三萜含量的影响(Effects of 5 extracts of Chinese herbal medicine on the content of three terpene in Ganoderma lucidum).doc
- 6.1 模板(6.1 templates).doc
- 06全口带入及问题(06 full mouth intake and problems).doc
- 6aunit3第一课时(6aunit3 first class).doc
- 6级英语单词p(6 English words p).doc
- 7 给水排水(7 water supply and drainage).doc
- 数据结构课程资料35(Data structure course information 35).doc
- 数据结构练习(三)1654(Data structure exercise (three) 1654).doc
- 数据结构模拟试题(1)(Data structure simulation questions (1)).doc
- 数据结构期末试卷B7478(Data structure final exam B7478).doc
- 数据结构上机(Data structure on computer).doc
- 数据结构实验——中缀表达式向后缀表达式的转化(包括四则运算和幂运算)——详细注释(Conversion of data structure experiment infix expression to suffix expression (including the four operations and exponentiation), detailed notes).doc
- 数据结构算法演示(Windows版)(Data structure algorithm demonstration (Windows version)).doc
- 数据结构题目(Data structure title).doc
- 数据结构实验一答案(Data structure experiment one answer).doc
- 数据结构图的建立与计算(Establishment and calculation of data structure diagram).doc
文档评论(0)