二叉树
_sophon
Brooding renders me prophetic
展开
-
二叉树(递归)
文章目录类型定义先序遍历中序遍历后序遍历层序遍历建树完整类型定义typedef char DataType;typedef struct BTreeNode{ DataType data; struct BTreeNode * leftchild; struct BTreeNode * rightchild; }BinTreeNode;typedef BinTreeNode * ...原创 2019-02-19 20:19:48 · 6382 阅读 · 0 评论 -
二叉树(非递归)
#include <bits/stdc++.h>using namespace std;typedef char DataType;typedef struct BTreeNode{ DataType data; struct BTreeNode * leftchild; struct BTreeNode * rightchild; }BinTreeNode;typ...原创 2019-02-20 14:33:31 · 828 阅读 · 0 评论 -
二叉树 其他
统计叶子数int CountLeafNode(BinTree bt){ if(bt==NULL) { return 0; } if(bt->leftchild==NULL&&bt->rightchild==NULL) { return 1; } return (CountLeafNode(bt->leftchild)+CountLea...原创 2019-02-20 15:07:45 · 100 阅读 · 0 评论