这是我第一次自己写出一个完整的数据结构代码,放在这里记录一下。同时也在梳理一遍代码的结构。
代码实现的是链式存储建立多项式并输出。
#include <iostream>
using namespace std;
// 定义多项式的节点
typedef struct DATA
{
int index;//多项式的系数
int coef;//多项式的指数
}DATA;
typedef struct listpoint{
struct DATA data;//数据域
listpoint * next;//指针域
}listpoint, * plistpoint;
//创建一个链表
plistpoint creat(){
int len;