init_实验三

This commit is contained in:
2024-11-22 18:12:51 +08:00
parent 89152214b3
commit 7f8acf4da1
2 changed files with 23 additions and 2 deletions
+2 -2
View File
@@ -3,6 +3,6 @@ project(homework4)
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
add_executable(test1 BiTree.h add_executable(test1 test1.cpp BiTree.h)
test1.cpp)
add_executable(test2 test2.cpp BiTree.h) add_executable(test2 test2.cpp BiTree.h)
add_executable(test3 test3.cpp BiTree.h)
+21
View File
@@ -0,0 +1,21 @@
/*
* 给定一棵二叉树的先序遍历序列和中序遍历序列,要求计算该二叉树的高度。
* 输入格式:
* 输入首先给出正整数N(≤50),为树中结点总数。下面两行先后给出先序和中序遍历序列,均是长度为N的不包含重复英文字母(区别大小写)的字符串。
* 输出格式:
* 输出为一个整数,即该二叉树的高度。
* 输入样例:
* 9
* ABDFGHIEC
* FDHGIBEAC
* 输出样例:
* 5
*/
#include"BiTree.h"
#include<iostream>
using namespace std;
int main()
{
return 0;
}