?? 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 + -