📄 bitree.h
字号:
// bitree.h: interface for the bitree class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_BITREE_H__FFCF161E_BC53_4497_9086_C8854C8EF8CB__INCLUDED_)
#define AFX_BITREE_H__FFCF161E_BC53_4497_9086_C8854C8EF8CB__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
typedef char Type;
struct BiTNode
{
Type data;
struct BiTNode *lchild,*rchild;
};
class BiTree
{
BiTNode* root;
int static sign;
public:
int getsign();
void Insert(BiTNode *T,BiTNode *p,bool left);
BiTNode * getroot();
BiTNode* Find(BiTNode *p,Type e,BiTNode *&q);
int PreOrderCreatBiTree(BiTNode* &T);
static void PreTraverse(BiTNode* T);
static int Depth(BiTNode *p);
int Depth(){ return Depth(root); }
void PreTraverse(){ PreTraverse(root); }
BiTNode *LeftChild( BiTNode *p);
BiTNode *RightChild( BiTNode *p );
void SetRoot( BiTNode* T ){ root = T ; }
BiTNode *GetRoot( )const{ return root; }
BiTree(){ root = 0; }
BiTree(BiTNode* T){ root = T; }
virtual ~BiTree();
};
#endif // !defined(AFX_BITREE_H__FFCF161E_BC53_4497_9086_C8854C8EF8CB__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -