?? bitree.cpp
字號:
// bitree.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "tree.h"
#define SIZE 12
int main(int argc, char* argv[])
{
CTree tree;
tree.m_pRoot=new CTreeNode[SIZE];
tree.m_pRoot[0].m_pLeft=&tree.m_pRoot[1];
tree.m_pRoot[0].m_pRight=&tree.m_pRoot[2];
tree.m_pRoot[1].m_pLeft=&tree.m_pRoot[3];
tree.m_pRoot[1].m_pRight=&tree.m_pRoot[4];
tree.m_pRoot[2].m_pLeft=&tree.m_pRoot[5];
tree.m_pRoot[2].m_pRight=&tree.m_pRoot[6];
tree.m_pRoot[3].m_pRight=&tree.m_pRoot[7];
tree.m_pRoot[6].m_pLeft=&tree.m_pRoot[8];
tree.m_pRoot[7].m_pLeft=&tree.m_pRoot[9];
tree.m_pRoot[7].m_pRight=&tree.m_pRoot[10];
tree.m_pRoot[9].m_pRight=&tree.m_pRoot[11];
for(long i=0;i<SIZE;i++)
tree.m_pRoot[i].m_data=i+1;
tree.CheckNodeNum(tree.m_pRoot);
cout<<tree.GetTreeNodeNum()<<endl;
cout<<tree.CheckDepth(tree.m_pRoot)<<endl;
for(i=0;i<SIZE;i++)
tree.m_pRoot[i].Clear();
delete [] tree.m_pRoot;
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -