From 5406753bbe1b603bb3ad3beb825fd6561f5f2dc2 Mon Sep 17 00:00:00 2001 From: Alessandro Ferro <49845537+xfarrow@users.noreply.github.com> Date: Fri, 21 May 2021 09:34:15 +0200 Subject: [PATCH] Library 4 --- librerie/exercise4/bst/bst.cpp | 2 +- librerie/exercise4/build.sh | 2 +- librerie/exercise4/zlasdtest/binarytree/binarytree.hpp | 0 librerie/exercise4/zlasdtest/bst/bst.hpp | 0 librerie/exercise4/zlasdtest/container/container.cpp | 0 librerie/exercise4/zlasdtest/container/container.hpp | 0 librerie/exercise4/zlasdtest/exercise1/fulltest.cpp | 0 librerie/exercise4/zlasdtest/exercise1/simpletest.cpp | 0 librerie/exercise4/zlasdtest/exercise1/test.hpp | 0 librerie/exercise4/zlasdtest/exercise2/fulltest.cpp | 0 librerie/exercise4/zlasdtest/exercise2/simpletest.cpp | 0 librerie/exercise4/zlasdtest/exercise2/test.hpp | 0 librerie/exercise4/zlasdtest/exercise3/fulltest.cpp | 0 librerie/exercise4/zlasdtest/exercise3/simpletest.cpp | 0 librerie/exercise4/zlasdtest/exercise3/test.hpp | 0 librerie/exercise4/zlasdtest/exercise4/fulltest.cpp | 0 librerie/exercise4/zlasdtest/exercise4/test.hpp | 0 librerie/exercise4/zlasdtest/iterator/iterator.hpp | 0 librerie/exercise4/zlasdtest/list/list.hpp | 0 librerie/exercise4/zlasdtest/queue/queue.hpp | 0 librerie/exercise4/zlasdtest/stack/stack.hpp | 0 librerie/exercise4/zlasdtest/test.cpp | 0 librerie/exercise4/zlasdtest/test.hpp | 0 librerie/exercise4/zlasdtest/vector/vector.hpp | 0 librerie/exercise4/zmytest/test.cpp | 8 ++++---- 25 files changed, 6 insertions(+), 6 deletions(-) mode change 100755 => 100644 librerie/exercise4/zlasdtest/binarytree/binarytree.hpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/bst/bst.hpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/container/container.cpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/container/container.hpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/exercise1/fulltest.cpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/exercise1/simpletest.cpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/exercise1/test.hpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/exercise2/fulltest.cpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/exercise2/simpletest.cpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/exercise2/test.hpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/exercise3/fulltest.cpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/exercise3/simpletest.cpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/exercise3/test.hpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/exercise4/fulltest.cpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/exercise4/test.hpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/iterator/iterator.hpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/list/list.hpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/queue/queue.hpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/stack/stack.hpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/test.cpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/test.hpp mode change 100755 => 100644 librerie/exercise4/zlasdtest/vector/vector.hpp 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<