template<typename DataType>
class AVLTree
{
public:
private:
class AVLNode
{
public:
DataType data;
int balanceFactor;
AVLNode *left;
AVLNode *right;
AVLNode():balanceFactor(0),left(NULL),right(NULL){}
AVLNode(DataType item):balanceFactor(0), data(item),left(NULL), right(NULL){}
};
typedef AVLNode* AVLNodePointer;
AVLNodePointer root;
int height(AVLTree<DataType>::AVLNodePointer temp);
int different(AVLTree<DataType>::AVLNodePointer temp);
AVLNodePointer ll_rotation(AVLTree<DataType>::AVLNodePointer parent);
};
template<typename DataType>
AVLNodePointer AVLTree<DataType>:: ll_rotation(AVLTree<DataType>::AVLNodePointer parent)
{
}
但這個聲明給出了一個編譯器錯誤。我怎樣才能在課堂外聲明這個功能?只要編輯一些打字錯誤,但仍然有錯誤我如何在私人課堂上訪問功能?
究竟是什麼編譯器錯誤? – 2015-04-04 08:15:01
它說AVLNodePointer不會命名一個類型 – Tony 2015-04-04 08:25:16