您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 经营企划 > 数据结构课程设计(一元稀疏多项式计算器)
eaintheaccidentinvestigation,managementandreporting,eachpostshouldbedevelopedunderthissystemspecialistscheck,cleartheexaminations,time,cyclesandotherrelevantregulations.Strengtheningsitesupervisionandexamination,todetectandinvestigateillegalcommand,illegaloperationsandviolationsofoperatingrules.Secondsafetyreferstotheproductionsite,technologymanagement,equipment,facilities,andsooncanleadtoaccidentsrisksexist.1,accordingtotheextentofthesecurityrisks,solvingisdividedintoa,b,andclevelsofdifficulty;A-level:difficult,miningdifficulties,shallbereportedtothecompany'sproblems.B-class:difficulttoresolvedif听范读短文的录音。学生根据拼音自由朗读短文,不会拼读的音节求助同学或老师。听老师读短文,把自己不会认读的字和词听清楚。指名朗读,重点纠正“蓝”“绿”“帆”的读音。齐读短文,进一步熟悉短文。你最喜欢哪一句话?指导学生有感情地朗读。ficulties,shallconsistofminingorganizationstosolveproblems.C-class:fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment.2,open-pitmineunsafetypesinclude:electrical,transport,blasting,fire,andotherslope.3,accordingtotheseverityofthehazardfilledinbyunittroubleshooting,registrationform(seeatt实习报告:1.5题一元稀疏多项式计算器题目:设计一个一元稀疏多项式简单计算器班级:计科一班姓名:康宇学号:完成日期:2013.4.15一、需求分析1、一元稀疏多项式简单计算器的功能是:1)输入并建立多项式;2)输出多项式,输出形式为整数序列:n,c1,e1,c2,e2,………cn,en,其中n是多项式的项数,ci和ei分别是第i项的系数和指数,序列按指数降序排列;3)多项式a和b相加,建立多项式a+b;4)多项式a和b相减,建立多项式a-b。5)计算多项式在x处的值;6)求多项式a、b的导函数;2、测试数据:1、(2x+5x^8-3.1x^11)+(7-5x^8+11x^9)=(-3.1x^11+11x^9+2x+7);2、(6x^-3-x+4.4x^2-1.2x^9+1.2x^9)-(-6x^-3+5.4x^2-x^2+7.8x^15)=(-7.8x^15-1.2x^9+12x^-3-x);3、(1+x+x^2+x^3+x^4+x^5)+(-x^3-x^4)=(1+x+x^2+x^5);4、(x+x^3)+(-x-x^3)=0;5、(x+x^100)+(x^100+x^200)=(x+2x^100+x^200);6、(x+x^2+x^3)+0=x+x^2+x^3.二、概要设计为实现上述程序功能,应以有序链表来表示多项式的系数和指数。定义线性表的动态分配顺序存储结构;建立多项式存储结构,定义指针*next利用链表实现队列的构造。每次输入一项的系数和指数,可以输出构造的一元多项式演示程序以用户和计算机的对话方式执行,即在计算机终站上显示“提示信息”之后,由用户在键盘上输入演示程序中规定的运行命令;最后根据相应的输入数据(滤去输入中的非法字符)建立的多项式以及多项式相加的运行结果在屏幕上显示。1、元素类型、结点类型和指针类型:typedefstructLNode{floatxishu;//系数intzhishu;//指数structLNode*next;实习报告eaintheaccidentinvestigation,managementandreporting,eachpostshouldbedevelopedunderthissystemspecialistscheck,cleartheexaminations,time,cyclesandotherrelevantregulations.Strengtheningsitesupervisionandexamination,todetectandinvestigateillegalcommand,illegaloperationsandviolationsofoperatingrules.Secondsafetyreferstotheproductionsite,technologymanagement,equipment,facilities,andsooncanleadtoaccidentsrisksexist.1,accordingtotheextentofthesecurityrisks,solvingisdividedintoa,b,andclevelsofdifficulty;A-level:difficult,miningdifficulties,shallbereportedtothecompany'sproblems.B-class:difficulttoresolvedif听范读短文的录音。学生根据拼音自由朗读短文,不会拼读的音节求助同学或老师。听老师读短文,把自己不会认读的字和词听清楚。指名朗读,重点纠正“蓝”“绿”“帆”的读音。齐读短文,进一步熟悉短文。你最喜欢哪一句话?指导学生有感情地朗读。ficulties,shallconsistofminingorganizationstosolveproblems.C-class:fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment.2,open-pitmineunsafetypesinclude:electrical,transport,blasting,fire,andotherslope.3,accordingtotheseverityofthehazardfilledinbyunittroubleshooting,registrationform(seeatt}LNode,*Linklist;2、建立两个全局链表指针,LinklistList1=NULL;LinklistList2=NULL;用来存放两个多项式,然后在main()函数里调用输入函数。3、本程序包括7个模块1)主程序:Voidmain(){While(1){输出菜单;接受命令;处理命令;If(命令==退出)则程序退出;}释放链表;}2)输入函数:VoidInput(){调用插值函数In(List1)处理链表一;调用插值函数In(List2)处理链表二;}3)输出函数:VoidOutput(){调用输值函数Out(List1)处理链表一;调用输值函数Out(List2)处理链表一;}4)相加函数:VoidAdd(){if(List1节点指数List2节点指数)输出List1节点;指针后移;elseif(List1节点指数List2节点指数)输出List2节点;指针后移;else输出两节点相加后的值;两链表指针都后移;eaintheaccidentinvestigation,managementandreporting,eachpostshouldbedevelopedunderthissystemspecialistscheck,cleartheexaminations,time,cyclesandotherrelevantregulations.Strengtheningsitesupervisionandexamination,todetectandinvestigateillegalcommand,illegaloperationsandviolationsofoperatingrules.Secondsafetyreferstotheproductionsite,technologymanagement,equipment,facilities,andsooncanleadtoaccidentsrisksexist.1,accordingtotheextentofthesecurityrisks,solvingisdividedintoa,b,andclevelsofdifficulty;A-level:difficult,miningdifficulties,shallbereportedtothecompany'sproblems.B-class:difficulttoresolvedif听范读短文的录音。学生根据拼音自由朗读短文,不会拼读的音节求助同学或老师。听老师读短文,把自己不会认读的字和词听清楚。指名朗读,重点纠正“蓝”“绿”“帆”的读音。齐读短文,进一步熟悉短文。你最喜欢哪一句话?指导学生有感情地朗读。ficulties,shallconsistofminingorganizationstosolveproblems.C-class:fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment.2,open-pitmineunsafetypesinclude:electrical,transport,blasting,fire,andotherslope.3,accordingtotheseverityofthehazardfilledinbyunittroubleshooting,registrationform(seeattif(链表1到头)输出链表2剩余的节点;else(即链表二到头)输出链表1剩余的节点;}5)相减函数:VoidSub(){if(List1节点指数List2节点指数)输出List1节点;指针后移;elseif(List1节点指数List2节点指数)输出List2节点;(系数要取负再输出)指针后移;Else两链表指针都后移;if(链表1到头)输出链表2剩余的节点;else(即链表二到头)输出链表1剩余的节点;}6)求值函数:voidCalc(){输入x的值;依次调用链表一的节点,求出单项式的值相加后输出;}7)求导函数:voidDaohanshu(){输出多项式一的导函数;}三、详细设计#includestdio.h#includestdlib.h#includemath.htypedefstructLNode//元素类型{floatxishu;intzhishu;structLNode*next;}LNode,*Linklist;eaintheaccidentinvestigation,managementandreporting,eachpostshouldbedevelopedunderthissystemspecialistscheck,cleartheexaminations,time,cyclesandotherrelevantregulations.Strengtheningsitesupervisionandexamination,todetectandinvestigateillegalcommand,illeg
本文标题:数据结构课程设计(一元稀疏多项式计算器)
链接地址:https://www.777doc.com/doc-2273433 .html