Can anyone see what the problem with this may be?
Code:
template <class T>
BSTree<T>& BSTree<T>::operator= (const BSTree<T>& bst)
{
if (this != &bst)
{
if (!isEmpty())
clear(root);
root=copyTree(bst.root);
}
return *this;
}
template <class T>
BTNode<T> *copyTree (BTNode<T> *treeRoot)
{
BTNode<T> *newTree, *lptr, *rptr;
if (treeRoot==NULL)
return NULL;
else
{
treeCopy=new BTNode<T>;
treeCopy->info=treeRoot->info;
treeCopy->lptr=copyTree(treeRoot->left);
treeCopy->rptr=copyTree(treeRoot->right);
}
return treeCopy;
}