Library 4

bug fix (see prev. commit)
This commit is contained in:
Alessandro Ferro
2021-05-25 15:58:25 +02:00
parent 828a41dd72
commit b7c12b8c8a
3 changed files with 15 additions and 11 deletions

View File

@ -61,9 +61,13 @@ const Data& BinaryTree<Data>::Node::Element() const{
/* ----- end of struct Node ----- */
template <typename Data>
bool BinaryTree<Data>::operator==(const BinaryTree& toCompare) const noexcept{
if(size!=toCompare.size) return false;
return(Root() == toCompare.Root());
bool BinaryTree<Data>::operator==(const BinaryTree& tree) const noexcept{
if(size == tree.size){
if(size == 0) return true;
else return (Root() == tree.Root());
}else{
return false;
}
}
template <typename Data>