我已经实现了一个功能节点插入到它像这样不工作的功能,没有错误
template<class nodetype>
void AVLtree<nodetype>::display() const
{
display(Proot);
}
template<class nodetype>
void AVLtree<nodetype>::display(Node<nodetype> * ptr) const
{
if(ptr==0)
return ;
cout<<ptr->value<<" ";
display(ptr->Pleft);
display(ptr->Pright);
}
编译后
后显示AVL树,没有任何错误,程序工作,但什么也没有印上屏幕
请帮我.... .... 谢谢
我没有在这里看到的一个问题。你怎么填满你的树? – 2010-04-12 22:45:05
没有错误?那么警告呢?任何只是因为你的代码在语法上是正确的,并不意味着它是非常正确的:) – hhafez 2010-04-12 22:48:23
什么是nodetype?你确定发送给cout时应该打印什么吗? – 2010-04-12 22:52:54