数据结构实验课
caicai____
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
图的遍历(邻接矩阵+邻接表+无向图+有向图+bfs+dfs)
#include<iostream> #include<map> #include<queue> #include<stack> using namespace std; //邻接矩阵 template<class T> class MatrixG { public: ~MatrixG() { //delete数组是这样delete 然后如果输出c或者c[x] 目前不会输出东西 推断是 野指针指向地方为空 delete []c;...原创 2021-11-30 20:01:10 · 326 阅读 · 0 评论 -
顺序栈实现算术表达式的计算
#include<iostream> #include<string> #include<map> using namespace std; template <class T> class Stack { public: Stack(int size) { elements = new T[size]; MaxSize = size; topp =0; } ~Stack() { delete []elements; } voi.原创 2021-11-09 21:43:02 · 1107 阅读 · 0 评论 -
优先队列构造哈夫曼编码(文件/map)
** 不使用文件进行存储: ** #include<iostream> #include<fstream> #include<queue> #include<string> #include<map> using namespace std; template<class T> struct HuffmanNode { double val; T name; HuffmanNode* left,*right; }; cla...原创 2021-11-29 13:26:28 · 799 阅读 · 0 评论
分享