Librray 3

bugfix on BinaryTree<Data>::Node::EqualNodes
This commit is contained in:
Alessandro Ferro
2021-05-04 21:28:10 +02:00
parent 46c52c6132
commit 858e7debee
6 changed files with 44 additions and 14 deletions

View File

@ -32,7 +32,7 @@ bool BinaryTreeVec<Data>::NodeVec::IsLeaf() const noexcept{
template <typename Data>
bool BinaryTreeVec<Data>::NodeVec::HasLeftChild() const noexcept{
if(index*2+1 < ReferenceToTree->size){
if( (index*2)+1 < ReferenceToTree->size){
return true;
}else{
return false;
@ -41,7 +41,7 @@ bool BinaryTreeVec<Data>::NodeVec::HasLeftChild() const noexcept{
template <typename Data>
bool BinaryTreeVec<Data>::NodeVec::HasRightChild() const noexcept{
if(index*2+2 < ReferenceToTree->size){
if((index*2)+2 < ReferenceToTree->size){
return true;
}else{
return false;