diff --git a/librerie/exercise3/binarytree/lnk/binarytreelnk.cpp b/librerie/exercise3/binarytree/lnk/binarytreelnk.cpp index ce823cc..9a393f9 100755 --- a/librerie/exercise3/binarytree/lnk/binarytreelnk.cpp +++ b/librerie/exercise3/binarytree/lnk/binarytreelnk.cpp @@ -142,7 +142,11 @@ BinaryTreeLnk& BinaryTreeLnk::operator=(BinaryTreeLnk&& tree) template bool BinaryTreeLnk::operator==(const BinaryTreeLnk& tree) const noexcept{ - return (Root() == tree.Root()); + if(size == tree.size){ + return (Root() == tree.Root()); + }else{ + return false; + } } template diff --git a/librerie/exercise3/binarytree/vec/binarytreevec.cpp b/librerie/exercise3/binarytree/vec/binarytreevec.cpp index 89e0c35..ae60260 100755 --- a/librerie/exercise3/binarytree/vec/binarytreevec.cpp +++ b/librerie/exercise3/binarytree/vec/binarytreevec.cpp @@ -105,6 +105,7 @@ BinaryTreeVec::~BinaryTreeVec(){ template BinaryTreeVec& BinaryTreeVec::operator=(const BinaryTreeVec& bt){ + Clear(); size = bt.size; tree.Resize(size); for(ulong i=0 ; i& BinaryTreeVec::operator=(const BinaryTreeVec& b template BinaryTreeVec& BinaryTreeVec::operator=(BinaryTreeVec&& bt) noexcept{ + Clear(); std::swap(size, bt.size); std::swap(tree, bt.tree); for(ulong i=0 ; i