📄 main.cpp
字号:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "treeabc.h"
#include "avl.h"
#include "print.h"
#include "thread.h"
using namespace std;
int main()
{
int i;
AVLTree* pRoot = NULL;
srand((unsigned int)::time(NULL));
for (i = 0; i < 10; ++i)
{
pRoot = Insert(::rand(), pRoot);
}
PrintTree(pRoot);
BiTree = (AVLTree *)malloc(sizeof(AVLTree));
//cout<<"输入节点数据(char 型)(#代表NULL):"<<endl;
//BiTree = CreateBiTree(BiTree);
BiTree = InOrderThreading(pRoot);
cout<<"线索化后遍历输出:"<<endl;
InOrderTraverse(pRoot);
cout<<"pRoot指针的value是:"<<pRoot->nData<<" nHeight值为:"<<pRoot->nHeight<<endl;
cout<<"pRoot指针的左子的value是"<<pRoot->pLeft->nData<<" nHeight值为:"<<pRoot->pLeft->nHeight<<endl;
//printBTree(pRoot);
//DeleteTree(&pRoot);
system("pause");
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -