关于二叉查找树程序
本人近日编了一个二叉查找树的程序,编译出现一些本人不太懂的错误,希望高手能指点一下,谢谢了!
error C2953: 'Key' : template class has already been defined这是什么错误啊?
错误2:
error C2371: 'Elem' : redefinition; different basic types
上一个错误的源代码如下:
BinNode<Elem>* BST<class Key,class Elem,class KEComp>::inserthelp(BinNode<Elem>* subroot,Key&k)
{
if(subroot==NULL) return new BinNode<Elem>(k.getname(),k.getx(),k.gety(),NULL,NULL);
if(KEComp::lt(k,subroot->getname())) subroot->setleft(inserthelp(subroot->left(),k));
if(KEComp::gt(k,subroot->getname())) subroot->setright(inserthelp(subroot->right(),k));
return subroot;
}
错误3:
error C2955: 'BinNode' : use of class template requires template argument list