- 博客(5)
- 收藏
- 关注
原创 【c++数据结构】链表类实现(循环 双向 静态)
#include<iostream> using namespace std; //有附加头节点的循环链表 template <class T> struct CircLinkNode { T data; CircLinkNode<T>* link; CircLinkNode(CircLinkNode* next = NULL) { data = 0; link = next; } CircLinkNode(T d, CircLinkNode* ne.
2022-05-09 21:19:52
197
原创 【c++数据结构】多项式类及相加相乘
#include<iostream> using namespace std; struct Term { float coef; int exp; Term* link; Term(float c, int e, Term* next = NULL) { coef = c, exp = e, link = next; } Term* InsertAfter(float c, int e); friend ostream& operator<<(ost.
2022-05-07 00:16:58
819
原创 【c++数据结构】单链表(带附加结点)
链表类实现,包括增删改查、从尾到头输出、定位倒数第i个元素、翻转链表、合并两个已经排好序的链表、找到两个单向链表相交的第一个公共点
2022-05-07 00:15:10
782
原创 【c++数据结构】顺序表 继承线性表类
#include <iostream> #include<stdio.h> #include"LinearList.h" using namespace std; const int defaultSize =30; template<class T> class LinearList { public: LinearList() {} ~LinearList() {} virtual int Size()const = 0; virtual int Leng.
2022-05-01 17:48:39
1114
原创 【c++数据结构】数组类封装
#include<iostream> using namespace std; template <class T> class Array { private: T *arr; int arrNum; //数组长度 int arrCapacity; //数组容量 public: Array() { //无.
2022-05-01 17:42:59
1259
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人