⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 write a c program to find the depth or height of a tree..txt

📁 It is an ebook about trees
💻 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 + -