📄 avltree.h
字号:
/*
*file: AVLTree.h
*date: 2004.12.9
*author:
*description:
* A self-balanced tree with balance-factorial.
* This file is the declarations of the template.
*/
#ifndef __AVLTree_h__
#define __AVLTree_h__
#include "Counter.h"
static Counter ct;
template<class KeyType>
class AVLTree
{
public:
AVLTree(KeyType key);
KeyType key() const;
void key(KeyType);
int insert(KeyType,AVLTree*&);
bool del(KeyType,AVLTree*&);
virtual ~AVLTree();
void clearCounter();
Counter getCounter();
void out();
//static int r,l;
private:
/*static class Counter
{
public:
int r,l;
}ct;*/
KeyType _key;
int _bf,h;
AVLTree* _lChild;
AVLTree* _rChild;
void renodeRight(AVLTree*& Gr,AVLTree* Pr/*,AVLTree* Ch*/);
void renodeLeft(AVLTree*& Gr,AVLTree* Pr/*,AVLTree* Ch*/);
void lChild(AVLTree*);
void rChild(AVLTree*);
void delbyCopy(AVLTree*&);
bool hasLChild();
bool hasRChild();
bool hasNoChildren();
int reH();
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -