24 lines
No EOL
428 B
C++
24 lines
No EOL
428 B
C++
#include <iostream>
|
|
#include "BST.hpp"
|
|
|
|
int main()
|
|
{
|
|
printf("初始化\n");
|
|
BST bst(31);
|
|
|
|
printf("========层次遍历========\n");
|
|
bst.trav_level();
|
|
|
|
printf("\n========先序遍历========\n");
|
|
bst.trav_pre();
|
|
|
|
printf("========中序遍历========\n");
|
|
bst.trav_in();
|
|
|
|
printf("========后序遍历========\n");
|
|
bst.trav_post();
|
|
|
|
printf("高度为%d\n",bst.height());
|
|
|
|
return 0;
|
|
} |