📄 tree.h
字号:
///////////////////////////////////////////////////////////////////////
//
// Tree.h - contains definitions of the base "Tree" structure.
//
// @(#)$Header:$
//
// Description:
// This file contains the base type and information for the bare
// sorting and searching routines in the Tree module. It needs
// to be augmented to do anything that is actually useful.
//
///////////////////////////////////////////////////////////////////////
class Tree;
class Node {
protected:
Node *left;
Node *right;
private:
void balance();
void list(int depth);
public:
Node();
virtual int is_greater(Node *t) = 0;
virtual int is_equal(Node *t) = 0;
virtual void print() = 0;
friend Tree;
};
class Tree {
protected:
Node *root;
public:
Tree();
Node *insert(Node *x);
Node *search(Node *x);
void list();
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -