Library 3 & Library 4

- resolved bug in library 3 (and in lib4)
- 0 errors in simpletests for library 4
This commit is contained in:
Alessandro Ferro
2021-05-13 18:38:07 +02:00
parent 2b7c59412c
commit 90f20eb405
6 changed files with 108 additions and 85 deletions

View File

@ -419,7 +419,7 @@ void BTPostOrderIterator<Data>::operator++(){
if(stack.Empty()){
curr = nullptr;
}else{
if( curr == &((stack.Top())->LeftChild()) ){
if((stack.Top())->HasLeftChild() && curr == &((stack.Top())->LeftChild()) ){
if( (stack.Top())->HasRightChild() ){
curr = DeepestLeftLeaf(&((stack.Top())->RightChild()));
}else{

View File

@ -15,10 +15,11 @@ protected:
protected:
using BinaryTree<Data>::Node::data;
public:
struct NodeLnk* left = nullptr;
struct NodeLnk* right = nullptr;
public:
struct NodeLnk& operator=(const NodeLnk&); // Copy assignment of abstract types should not be possible.
struct NodeLnk& operator=(NodeLnk&&) noexcept; // Move assignment of abstract types should not be possible.
bool IsLeaf() const noexcept override; // (concrete function should not throw exceptions)