2018年11月16日

图的创建与dfs,bfs遍历

摘要: #include<iostream>#include<list>#include<fstream>#include<queue>#include<iostream>#include<list>#include<fstream>const double MAXCOST=10000;using name 阅读全文

posted @ 2018-11-16 20:17 Numb_lzw 阅读(345) 评论(0) 推荐(0) 编辑

2018年11月8日

树的创建与遍历

摘要: #include<iostream>#include<list>#include<fstream>#include<queue>using namespace std; template<class T>class Tree //树的建立{ T *NA; list<int> *HL; int roo 阅读全文

posted @ 2018-11-08 23:36 Numb_lzw 阅读(273) 评论(0) 推荐(0) 编辑

堆的实现

摘要: #include<iostream>#include<algorithm>#include<vector>using namespace std;int min(int a,int b){ return a>b?b:a;}template<class T> //堆的实现class Heap{ vec 阅读全文

posted @ 2018-11-08 22:26 Numb_lzw 阅读(181) 评论(0) 推荐(0) 编辑

2018年11月4日

利用二叉链表递归和非递归算法求叶子结点的数量

摘要: 这是我的博客的第一篇文章,是学校里布置的一道作业题。 之后有时间的话我会发布更多有意思的博客 #include<iostream>#include<stack>using namespace std;int cnt1=0,cnt2=0;struct BTNode{ int data; BTNode 阅读全文

posted @ 2018-11-04 21:38 Numb_lzw 阅读(740) 评论(0) 推荐(0) 编辑

导航