二叉树
文章平均质量分 63
xutian_curry
这个作者很懒,什么都没留下…
展开
-
二叉树的操作之由中根和后跟序列重建二叉树
#include <iostream>#include <vector>#include <string>#include <malloc.h>#include <stdio.h>#include <string.h>using namespace std;typedef struct node{ in...原创 2018-04-06 12:00:31 · 1578 阅读 · 0 评论 -
二叉树的深度
运用递归的思想来求解二叉树的深度#include <stdio.h>#define N 10int left[N+1], right[N+1];int func(int i){ if(left[i]==-1&&right[i]==-1) return 0;//递归出口 int dright; if(right[i]=...原创 2018-04-06 16:03:41 · 112 阅读 · 0 评论 -
二叉树操作之由前序遍历和中序遍历重建
#include <stdio.h>#include <malloc.h>#include <iostream>#include <string.h>using namespace std;typedef struct node{ char data; node *left,*right;}*BTree;void Po...原创 2018-04-06 16:33:43 · 91 阅读 · 0 评论 -
二叉搜索树的各种操作
#include <iostream>#include <malloc.h>#include <queue>#include <string>#include <string.h>#include <iomanip>#include <stdio.h>using namespace std;int原创 2018-05-12 18:47:04 · 93 阅读 · 0 评论 -
赫夫曼树 贪心
贪心问题,每次把权重最小的连接成新的树#include <iostream>#include <malloc.h>#include <queue>#include <string>#include <string.h>#include <iomanip>#include <stdio.h>#inclu原创 2018-05-12 19:03:12 · 121 阅读 · 0 评论 -
二叉树的操作
数组表示法#include <iostream>#include <malloc.h>#include <queue>#include <string>#include <string.h>#include <iomanip>#include <stdio.h>#include <que原创 2018-05-12 20:21:55 · 90 阅读 · 0 评论 -
文本二叉树
点击打开链接建立二叉树的一种方式#include <stdio.h>#include <iostream>#include <stack>#include <string>using namespace std;string s;int kase;typedef struct node{ char data; node...原创 2018-05-13 11:03:58 · 294 阅读 · 0 评论 -
二叉树
#include <iostream>#include <string>using namespace std;int main(){ int x,y; cin >> x >> y; while(1) { if( x > y ) x /= 2; el...原创 2018-06-13 19:35:52 · 122 阅读 · 0 评论