From 599433ced35d3dcc5bb3d2cf9292fc7614f1e250 Mon Sep 17 00:00:00 2001 From: Alessandro Ferro <49845537+xfarrow@users.noreply.github.com> Date: Tue, 11 May 2021 16:28:01 +0200 Subject: [PATCH] Library 4 few methods added --- librerie/exercise4/Exercise4.pdf | Bin librerie/exercise4/bst/bst.cpp | 25 +++++++++++++++--- librerie/exercise4/bst/bst.hpp | 24 +++++++---------- librerie/exercise4/build.sh | 0 librerie/exercise4/main.cpp | 0 .../zlasdtest/binarytree/binarytree.hpp | 0 librerie/exercise4/zlasdtest/bst/bst.hpp | 0 .../zlasdtest/container/container.cpp | 0 .../zlasdtest/container/container.hpp | 0 .../zlasdtest/exercise1/fulltest.cpp | 0 .../zlasdtest/exercise1/simpletest.cpp | 0 .../exercise4/zlasdtest/exercise1/test.hpp | 0 .../zlasdtest/exercise2/fulltest.cpp | 0 .../zlasdtest/exercise2/simpletest.cpp | 0 .../exercise4/zlasdtest/exercise2/test.hpp | 0 .../zlasdtest/exercise3/fulltest.cpp | 0 .../zlasdtest/exercise3/simpletest.cpp | 0 .../exercise4/zlasdtest/exercise3/test.hpp | 0 .../zlasdtest/exercise4/fulltest.cpp | 0 .../zlasdtest/exercise4/simpletest.cpp | 0 .../exercise4/zlasdtest/exercise4/test.hpp | 0 .../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 .../exercise4/zlasdtest/vector/vector.hpp | 0 librerie/exercise4/zmytest/test.cpp | 0 librerie/exercise4/zmytest/test.hpp | 0 30 files changed, 32 insertions(+), 17 deletions(-) mode change 100644 => 100755 librerie/exercise4/Exercise4.pdf mode change 100644 => 100755 librerie/exercise4/bst/bst.cpp mode change 100644 => 100755 librerie/exercise4/bst/bst.hpp mode change 100644 => 100755 librerie/exercise4/build.sh mode change 100644 => 100755 librerie/exercise4/main.cpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/binarytree/binarytree.hpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/bst/bst.hpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/container/container.cpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/container/container.hpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/exercise1/fulltest.cpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/exercise1/simpletest.cpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/exercise1/test.hpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/exercise2/fulltest.cpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/exercise2/simpletest.cpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/exercise2/test.hpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/exercise3/fulltest.cpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/exercise3/simpletest.cpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/exercise3/test.hpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/exercise4/fulltest.cpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/exercise4/simpletest.cpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/exercise4/test.hpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/iterator/iterator.hpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/list/list.hpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/queue/queue.hpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/stack/stack.hpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/test.cpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/test.hpp mode change 100644 => 100755 librerie/exercise4/zlasdtest/vector/vector.hpp mode change 100644 => 100755 librerie/exercise4/zmytest/test.cpp mode change 100644 => 100755 librerie/exercise4/zmytest/test.hpp diff --git a/librerie/exercise4/Exercise4.pdf b/librerie/exercise4/Exercise4.pdf old mode 100644 new mode 100755 diff --git a/librerie/exercise4/bst/bst.cpp b/librerie/exercise4/bst/bst.cpp old mode 100644 new mode 100755 index d374ceb..b7159c4 --- a/librerie/exercise4/bst/bst.cpp +++ b/librerie/exercise4/bst/bst.cpp @@ -1,10 +1,29 @@ namespace lasd { -/* ************************************************************************** */ +template +BST::BST(const BST& bst) + : BinaryTreeLnk(bst){} -// ... +template +BST::BST(BST&& bst) noexcept + : BinaryTreeLnk(std::move(bst)){} -/* ************************************************************************** */ +template +BST::~BST(){ + BinaryTreeLnk::Clear(); +} + +template +BST& BST::operator=(const BST& bst){ + BinaryTreeLnk::operator=(bst); + return *this; +} + +template +BST& BST::operator=(BST&& bst) noexcept{ + BinaryTreeLnk::operator=(std::move(bst)); + return *this; +} } diff --git a/librerie/exercise4/bst/bst.hpp b/librerie/exercise4/bst/bst.hpp old mode 100644 new mode 100755 index 26c3094..d068a91 --- a/librerie/exercise4/bst/bst.hpp +++ b/librerie/exercise4/bst/bst.hpp @@ -13,22 +13,18 @@ namespace lasd { /* ************************************************************************** */ template -class BST { // Must extend BinaryTreeLnk - -private: - - // ... +class BST : virtual public BinaryTreeLnk { // Must extend BinaryTreeLnk protected: - // using BinaryTreeLnk::???; + using BinaryTreeLnk::size; + using BinaryTreeLnk::root; + using typename BinaryTreeLnk::NodeLnk; - // ... public: - // Default constructor - // BST() specifiers; + BST() = default; /* ************************************************************************ */ @@ -38,23 +34,23 @@ public: /* ************************************************************************ */ // Copy constructor - // BST(argument) specifiers; + BST(const BST&); // Move constructor - // BST(argument) specifiers; + BST(BST&&) noexcept; /* ************************************************************************ */ // Destructor - // ~BST() specifiers; + ~BST(); /* ************************************************************************ */ // Copy assignment - // type operator=(argument) specifiers; + BST& operator=(const BST&); // Move assignment - // type operator=(argument) specifiers; + BST& operator=(BST&&) noexcept; /* ************************************************************************ */ diff --git a/librerie/exercise4/build.sh b/librerie/exercise4/build.sh old mode 100644 new mode 100755 diff --git a/librerie/exercise4/main.cpp b/librerie/exercise4/main.cpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/binarytree/binarytree.hpp b/librerie/exercise4/zlasdtest/binarytree/binarytree.hpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/bst/bst.hpp b/librerie/exercise4/zlasdtest/bst/bst.hpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/container/container.cpp b/librerie/exercise4/zlasdtest/container/container.cpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/container/container.hpp b/librerie/exercise4/zlasdtest/container/container.hpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/exercise1/fulltest.cpp b/librerie/exercise4/zlasdtest/exercise1/fulltest.cpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/exercise1/simpletest.cpp b/librerie/exercise4/zlasdtest/exercise1/simpletest.cpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/exercise1/test.hpp b/librerie/exercise4/zlasdtest/exercise1/test.hpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/exercise2/fulltest.cpp b/librerie/exercise4/zlasdtest/exercise2/fulltest.cpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/exercise2/simpletest.cpp b/librerie/exercise4/zlasdtest/exercise2/simpletest.cpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/exercise2/test.hpp b/librerie/exercise4/zlasdtest/exercise2/test.hpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/exercise3/fulltest.cpp b/librerie/exercise4/zlasdtest/exercise3/fulltest.cpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/exercise3/simpletest.cpp b/librerie/exercise4/zlasdtest/exercise3/simpletest.cpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/exercise3/test.hpp b/librerie/exercise4/zlasdtest/exercise3/test.hpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/exercise4/fulltest.cpp b/librerie/exercise4/zlasdtest/exercise4/fulltest.cpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/exercise4/simpletest.cpp b/librerie/exercise4/zlasdtest/exercise4/simpletest.cpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/exercise4/test.hpp b/librerie/exercise4/zlasdtest/exercise4/test.hpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/iterator/iterator.hpp b/librerie/exercise4/zlasdtest/iterator/iterator.hpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/list/list.hpp b/librerie/exercise4/zlasdtest/list/list.hpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/queue/queue.hpp b/librerie/exercise4/zlasdtest/queue/queue.hpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/stack/stack.hpp b/librerie/exercise4/zlasdtest/stack/stack.hpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/test.cpp b/librerie/exercise4/zlasdtest/test.cpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/test.hpp b/librerie/exercise4/zlasdtest/test.hpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zlasdtest/vector/vector.hpp b/librerie/exercise4/zlasdtest/vector/vector.hpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zmytest/test.cpp b/librerie/exercise4/zmytest/test.cpp old mode 100644 new mode 100755 diff --git a/librerie/exercise4/zmytest/test.hpp b/librerie/exercise4/zmytest/test.hpp old mode 100644 new mode 100755