二叉树
--SJJ
这个作者很懒,什么都没留下…
展开
-
二叉树 --先序 中序 后序
#include<stdio.h>#include<malloc.h> struct node{//建树 过程中输入这个树 char info; struct node *llink,*rlink; };typedef struct node NODE;NODE *creat(){ char x; NODE *p; scanf("%c",&a...原创 2018-12-04 17:10:08 · 185 阅读 · 0 评论 -
编写递归算法,计算二叉树中叶子结点的数目
编写递归算法,计算二叉树中叶子结点的数目1#include<iostream>using namespace std;typedef struct TNode//二叉树结构{ char nodeValue;//结点的值 TNode* left;//左子树 TNode* right;//右子树 }*BiTree;void CreateBiTree(Bi...原创 2018-12-04 17:08:11 · 42922 阅读 · 3 评论 -
编写递归算法,求在二叉树中先序序列中第k个位置的节点
编写递归算法,求在二叉树中先序序列中第k个位置的节点#include<stdio.h>//freopen()的头文件#include<malloc.h>#include<iostream>using namespace std;const int N=1000;struct node{ char info; struct node *llin...原创 2018-12-04 16:39:06 · 4194 阅读 · 3 评论