编写函数计算二叉树的深度以及叶子节点数。二叉树采用二叉链表存储结构
函数接口定义:
int GetDepthOfBiTree ( BiTree T);
int LeafCount(BiTree T);
其中 T是用户传入的参数,表示二叉树根节点的地址。函数须返回二叉树的深度(也称为高度)。
裁判测试程序样例:
//头文件包含
#include<stdlib.h>
#include<stdio.h>
#include<malloc.h>
//函数状态码定义
#define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
#define OVERFLOW -1