📄 binarytree.cpp
字号:
// BinaryTree.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include "BinTree.h"
#include <windows.h>
#include <tchar.h>
#include <assert.h>
#include <strsafe.h>
#include <exception>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
TCHAR szCWD[MAX_PATH] = {};
TCHAR szPath[MAX_PATH] = {};
DWORD dwRet;
dwRet = GetCurrentDirectory(MAX_PATH ,szCWD);
wprintf(L"%s\n" , szCWD);
if(SUCCEEDED(StringCchCopy(szPath , MAX_PATH , szCWD)))
wprintf(L"%s\n" , szPath);
int ai[8] = {4 , 3 , 1 ,2 ,5 ,7 ,6 ,8};
ThreadBinTree<int> *p =new ThreadBinTree<int>(ai[0]);
for(int i=1 ; i<8 ; i++)
{
try
{
p->BuildSortTree(ai[i]);
}
catch(...)
{
throw(1);
}
}
printf("%d\n" , p->Find(ai[3]));
ThreadPreOrderTree<int> *it = new ThreadPreOrderTree<int>(p);
// it->CreatePreThread();
delete p;
getchar();
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -