
二叉树
KingsCC
这个作者很懒,什么都没留下…
展开
-
二叉树 前序+中序>>后序
#include<stdio.h>#include<string>//using namespace std;struct Node{ Node *lch; Node *rch; char c;}tree[50];int n;//静态内存中已经分配的节点个数Node *create(){//申请节点空间并返回其指针 tree[...转载 2018-08-15 17:59:37 · 219 阅读 · 0 评论 -
建立二叉树
//根据输入的值顺序不同 树不唯一//输出前序遍历、中序遍历、后序遍历#include<stdio.h>#include<string>//using namespace std;struct Node{ Node *lch; Node *rch; int c;}tree[101];int n;//静态内存中已经分配的节点个数...转载 2018-08-15 18:36:08 · 334 阅读 · 0 评论 -
两棵树是否相同
核心是任意两种包括中序遍历的遍历结果相同,则树相同理解了一点指针的用法#include<iostream>#include<string.h>using namespace std;struct Node{ Node* lch; Node* rch; int num;}tree[110];int k,l;Node* creat...转载 2018-08-17 16:35:46 · 504 阅读 · 0 评论