From 7f8acf4da1632e51ce35fe341d975de895e98150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=A1=E5=9D=82=E6=98=B4?= Date: Fri, 22 Nov 2024 18:12:51 +0800 Subject: [PATCH] =?UTF-8?q?init=5F=E5=AE=9E=E9=AA=8C=E4=B8=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- homework4/CMakeLists.txt | 4 ++-- homework4/test3.cpp | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 homework4/test3.cpp diff --git a/homework4/CMakeLists.txt b/homework4/CMakeLists.txt index 4e4da73..10bca46 100644 --- a/homework4/CMakeLists.txt +++ b/homework4/CMakeLists.txt @@ -3,6 +3,6 @@ project(homework4) set(CMAKE_CXX_STANDARD 20) -add_executable(test1 BiTree.h - test1.cpp) +add_executable(test1 test1.cpp BiTree.h) add_executable(test2 test2.cpp BiTree.h) +add_executable(test3 test3.cpp BiTree.h) diff --git a/homework4/test3.cpp b/homework4/test3.cpp new file mode 100644 index 0000000..8af4a80 --- /dev/null +++ b/homework4/test3.cpp @@ -0,0 +1,21 @@ +/* + * 给定一棵二叉树的先序遍历序列和中序遍历序列,要求计算该二叉树的高度。 + * 输入格式: + * 输入首先给出正整数N(≤50),为树中结点总数。下面两行先后给出先序和中序遍历序列,均是长度为N的不包含重复英文字母(区别大小写)的字符串。 + * 输出格式: + * 输出为一个整数,即该二叉树的高度。 + * 输入样例: + * 9 + * ABDFGHIEC + * FDHGIBEAC + * 输出样例: + * 5 + */ +#include"BiTree.h" +#include +using namespace std; + +int main() +{ + return 0; +} \ No newline at end of file