本題要求給定二叉樹的高度。
函式介面定義:
int getheight( bintree bt );
其中bintree結構定義如下:
要求函式返回給定二叉樹bt的高度值。typedef struct tnode *position;
typedef position bintree;
struct tnode;
裁判測試程式樣例:
輸出樣例(對於圖中給出的樹):#include #include typedef char elementtype;
typedef struct tnode *position;
typedef position bintree;
struct tnode;
bintree creatbintree(); /* 實現細節忽略 */
int getheight( bintree bt );
int main()
/* 你的**將被嵌在這裡 */
![](https://pic.w3help.cc/469/35dc5592c2c3136b25345ba1e320c.jpeg)
4
**如下:
int getheight( bintree bt )
6 1 求二叉樹高度(20 分)
int getheight bintree bt 其中bintree結構定義如下 typedef struct tnode position typedef position bintree struct tnode 要求函式返回給定二叉樹bt的高度值。include include typedef...
6 1 求二叉樹高度 25分
本題要求給定二叉樹的高度。函式介面定義 int getheight bintree bt 其中bintree結構定義如下 typedef struct tnode position typedef position bintree struct tnode 要求函式返回給定二叉樹bt的高度值。裁判測...
6 1 求二叉樹高度 20分 PTA 函式題
本題要求給定二叉樹的高度。函式介面定義 int getheight bintree bt 其中bintree結構定義如下 typedef struct tnode position typedef position bintree struct tnode 要求函式返回給定二叉樹bt的高度值。裁判測...