📄 dlist.h
字号:
#if !defined _CDLIST_
#define _CDLIST_
#include "node.h"
class CPolynomial
{
private:
CTerm *m_pHead;
public:
CPolynomial(); //构造函数
//CPolynomial(const CPolynomial &cp); //拷贝构造函数
~CPolynomial(); //析构函数
int IsEmpty(); //判空
int Size(); //得到链表长度
int Locate(int degree, double value); //定位
CTerm *FindLast(); //找最后一个元素
CTerm *FindAt(int index); //在链表中查找一个元素
int Pushback(int degree, double value); //在链表尾部添加一个节点
int InsertAt(int index, int degree, double value); //在链表中插入一个节点
void Sort(); //排序
void Together(); //合并同类项
int RemoveAt(int index); //删除一个链表节点
//void RemoveAll(); //清空链表
int Print(); //输出链表
CPolynomial& operator=(const CPolynomial &C);
friend CPolynomial& operator+(const CPolynomial &C1, const CPolynomial &C2);
friend CPolynomial& operator-(const CPolynomial &C1, const CPolynomial &C2);
friend CPolynomial& operator*(const CPolynomial &C1, const CPolynomial &C2);
};
#endif // _CDLIST_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -