diff --git a/librerie/exercise4/bst/bst.cpp b/librerie/exercise4/bst/bst.cpp index db91a14..c84d4c4 100755 --- a/librerie/exercise4/bst/bst.cpp +++ b/librerie/exercise4/bst/bst.cpp @@ -324,7 +324,7 @@ typename BST::NodeLnk* const* BST::FindPointerToPredecessor(struct B Note: I return a ** instead of *& because we deferenciate a variable that might - contain nullptr (lastRight) that, without proper handling, would result to + contain nullptr (candidate) that, without proper handling, would result to an invalid read. I decided to keep it simpler to understand. */ diff --git a/librerie/exercise4/build.sh b/librerie/exercise4/build.sh index 1f825de..cf5567b 100755 --- a/librerie/exercise4/build.sh +++ b/librerie/exercise4/build.sh @@ -1,7 +1,7 @@ #! /bin/bash -g++-10 -o main \ +g++ -O3 -o main \ zlasdtest/exercise1/simpletest.cpp zlasdtest/exercise1/fulltest.cpp \ zlasdtest/exercise2/simpletest.cpp zlasdtest/exercise2/fulltest.cpp \ zlasdtest/exercise3/simpletest.cpp zlasdtest/exercise3/fulltest.cpp \ diff --git a/librerie/exercise4/zlasdtest/binarytree/binarytree.hpp b/librerie/exercise4/zlasdtest/binarytree/binarytree.hpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/bst/bst.hpp b/librerie/exercise4/zlasdtest/bst/bst.hpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/container/container.cpp b/librerie/exercise4/zlasdtest/container/container.cpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/container/container.hpp b/librerie/exercise4/zlasdtest/container/container.hpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/exercise1/fulltest.cpp b/librerie/exercise4/zlasdtest/exercise1/fulltest.cpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/exercise1/simpletest.cpp b/librerie/exercise4/zlasdtest/exercise1/simpletest.cpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/exercise1/test.hpp b/librerie/exercise4/zlasdtest/exercise1/test.hpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/exercise2/fulltest.cpp b/librerie/exercise4/zlasdtest/exercise2/fulltest.cpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/exercise2/simpletest.cpp b/librerie/exercise4/zlasdtest/exercise2/simpletest.cpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/exercise2/test.hpp b/librerie/exercise4/zlasdtest/exercise2/test.hpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/exercise3/fulltest.cpp b/librerie/exercise4/zlasdtest/exercise3/fulltest.cpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/exercise3/simpletest.cpp b/librerie/exercise4/zlasdtest/exercise3/simpletest.cpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/exercise3/test.hpp b/librerie/exercise4/zlasdtest/exercise3/test.hpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/exercise4/fulltest.cpp b/librerie/exercise4/zlasdtest/exercise4/fulltest.cpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/exercise4/test.hpp b/librerie/exercise4/zlasdtest/exercise4/test.hpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/iterator/iterator.hpp b/librerie/exercise4/zlasdtest/iterator/iterator.hpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/list/list.hpp b/librerie/exercise4/zlasdtest/list/list.hpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/queue/queue.hpp b/librerie/exercise4/zlasdtest/queue/queue.hpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/stack/stack.hpp b/librerie/exercise4/zlasdtest/stack/stack.hpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/test.cpp b/librerie/exercise4/zlasdtest/test.cpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/test.hpp b/librerie/exercise4/zlasdtest/test.hpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zlasdtest/vector/vector.hpp b/librerie/exercise4/zlasdtest/vector/vector.hpp old mode 100755 new mode 100644 diff --git a/librerie/exercise4/zmytest/test.cpp b/librerie/exercise4/zmytest/test.cpp index 87a6179..201fec9 100755 --- a/librerie/exercise4/zmytest/test.cpp +++ b/librerie/exercise4/zmytest/test.cpp @@ -611,7 +611,7 @@ bool NodeOperations(T& currentNode){ do{ cout<<" *** Element in the current node: "< GenerateIntegerBST(BST& bst){ default_random_engine gen(random_device{}()); uniform_int_distribution dist(0,1000); - cout<<"\n\nElements in the binary tree (in order of insertion):\n"; + cout<<"\n\nElements in the binary search tree (in order of insertion):\n"; for(ulong i=0 ; i GenerateFloatBST(BST& bst){ default_random_engine gen(random_device{}()); uniform_real_distribution distr(0,5); - cout<<"\n\nElements in the binary tree (in breadth order):\n"; + cout<<"\n\nElements in the binary search tree (in order of insertion):\n"; for(unsigned long i = 0; i < dim; ++i){ tmp[i] = (round(distr(gen)*10000))/100; cout< GenerateStringsBST(BST& bst){ default_random_engine gen(random_device{}()); uniform_int_distribution dist(1,5); - cout<<"\n\nElements in the tree (in breadth order):\n"; + cout<<"\n\nElements in the binary search tree (in order of insertion):\n"; for(ulong i = 0; i < dim; ++i){ tmp[i] = generateRandomString(dist(gen)); cout<