📄 write a c program to find the depth or height of a tree..txt
字号:
Write a C program to find the depth or height of a tree.
Discuss it!
#define max(x,y) ((x)>(y)?(x):(y))
struct Bintree{
int element;
struct Bintree *left;
struct Bintree *right;
};
typedef struct Bintree* Tree;
int height(Tree T)
{
if(!T)
return -1;
else
return (1 + max(height(T->left), height(T->right)))
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -