?? avltreem.cpp
字號:
//平衡二叉搜索樹的類測試AVLTREEM.cpp
#include<iostream.h>
#include<iomanip.h>
#include<conio.h>
#include<stdlib.h>
#include "AVLTREE.H"
TNode<char> *q;
void main()
{cout<<"AVLTREEM.cpp運(yùn)行結(jié)果:\n";
int i;
char test[50]="abxyMNcdefg";
BSTree<char> t(q);
//cout<<"input data:\n";
//gets(test);
for(i=0;test[i]!='\0';i++)
t.BSTInsert(q,test[i]);
cout<<"平衡二叉搜索樹的結(jié)點(diǎn)數(shù)="<<t.BSTSize()<<endl;
cout<<"平衡二叉搜索樹的結(jié)點(diǎn)數(shù)="<<t.BSTreeCount(q)<<endl;
cout<<"平衡二叉搜索樹的深度="<<t.BSTreeDepth(q)<<endl;
cout<<"平衡二叉搜索樹的葉子結(jié)點(diǎn)數(shù)="<<t.BSTreeLeafCount(q)<<endl;
cout<<"中序遍歷平衡二叉搜索樹:\n";
t.Inorder(q);
getch();
t.FreeBST(q);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -