Library 3

bugfix
This commit is contained in:
Alessandro Ferro
2021-05-05 10:03:25 +02:00
parent 858e7debee
commit 4add56d732
2 changed files with 12 additions and 7 deletions

View File

@ -147,12 +147,15 @@ bool BinaryTreeLnk<Data>::operator!=(const BinaryTreeLnk<Data>& tree) const noex
template <typename Data>
struct BinaryTree<Data>::Node& BinaryTreeLnk<Data>::Root() const{
if(size==0) throw std::length_error("Empty tree!");
return *root;
}
template <typename Data>
void BinaryTreeLnk<Data>::Clear(){
DeleteTree(root);
root = nullptr;
size = 0;
}
}