?? test.cpp
字號:
#include <iostream>
#define debug
#include "AVLTree.cpp"
using namespace std;
int main()
{
AVLTree<int>* tree;
int k=0;
cout<<"輸入樹:(-1 退出,0 顯示)"<<endl;
cin>>k;
tree=new AVLTree<int>(k);
while(1)
{
cin>>k;
if(k==0) tree->out();
else if(k==-1) break;
else tree->insert(k,tree);
}
cout<<"建立操作 左旋轉(zhuǎn):"<<ct.l<<" 右旋轉(zhuǎn):"<<ct.r<<endl;
tree->clearCounter();
cout<<"要?jiǎng)h除的節(jié)點(diǎn):(-1 退出,0 顯示)"<<endl;
while(1)
{
cin>>k;
if(k==0) tree->out();
else if(k==-1) break;
else tree->del(k,tree);
}
cout<<"刪除操作 左旋轉(zhuǎn):"<<ct.l<<" 右旋轉(zhuǎn):"<<ct.r<<endl;
delete tree;
return 0;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -