?? binary.cpp
字號:
// test binary tree class
#include <iostream.h>
#include "binary.h"
// globals
int count = 0;
BinaryTree<int> a,x,y,z;
template<class T>
void ct(BinaryTreeNode<T> *t) {count++;}
void main(void)
{
y.MakeTree(1,a,a);
z.MakeTree(2,a,a);
x.MakeTree(3,y,z);
y.MakeTree(4,x,a);
cout << "Preorder sequence is ";
y.PreOutput();
cout << "Inorder sequence is ";
y.InOutput();
cout << "Postorder sequence is ";
y.PostOutput();
cout << "Level order sequence is ";
y.LevelOutput();
cout << "Number of nodes = ";
cout << y.Size() << endl;
cout << "Height = ";
cout << y.Height() << endl;
y.PreOrder(ct);
cout << "Count of nodes is " << count << endl;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -