?? bintreenode.h
字號:
#ifndef BIN_TREE_NODE_CLASS
#define BIN_TREE_NODE_CLASS
#include <assert.h>
#include <iostream.h>
#include <iomanip.h>
#include <stdlib.h>
#ifndef NULL
const int NULL=0;
#endif
template <class T>
class BinaryTree;
template <class T>
class BinTreeNode
{
friend class BinaryTree<T>;
protected:
BinTreeNode<T> *left;
BinTreeNode<T> *right;
T data;
public:
BinTreeNode(const T & item,
BinTreeNode<T> *lptr=NULL,
BinTreeNode<T> *rptr=NULL):data(item),left(lptr),right(rptr){}
virtual ~BinTreeNode<T>(){}
T& Data(void){return data;}
const T & Data(void) const {return data;}
BinTreeNode<T> *Left(void) const {return left;}
BinTreeNode<T> *Right(void) const {return right;}
};
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -