treeapp.cpp

来自「c++书籍的源代码」· C++ 代码 · 共 29 行

CPP
29
字号
// treeapp.cpp
#include<iostream.h>
#include"tree.h"
 int main(void)
{
  tree t;
  t.build_t(10);
  t.build_t(18);
  t.build_t(32);	
  t.build_t(16);
  t.build_t(3);
  t.build_t(77);	
  t.build_t(200);
  cout<<"前序遍历:"<<endl;
  t.preorder(t.get_r());
  cout<<endl;
  cout<<"中序遍历:"<<endl;
  t.inorder(t.get_r());
  cout<<endl;
  cout<<"后序遍历:"<<endl;
  t.postorder(t.get_r());
  cout<<endl;
  return(0);
 }

	
	

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?