being this the header file of Asorter and Aseq, implement the join() method of class InsertSorter applying the preconditions and postconditions of the join() method stated in the .hpp file of class InsertSorter.
IN C++
Thank you.
join method pre and post is in there!
#ifndef ASORTER_HPP- #define ASORTER_HPP #include
#include "ASeq.hpp" // Asequence. using namespace std; class Asorter { public: void sort (ASeq &a, int lo, int ha); // Pre: &a, int lo, int &mid, int h) = 0; // Pre: lo }; void Asorter::sort (ASeq &a, int to, ant hi) { if (lo ::sort precondition failed." class Aseq { public: ASeq(int cap = 0); virtual -ASeg() = 0; virtual S &operator[](int i) = 0; // For read/write. virtual S const &operator[](int 1) const = 0; // For read-only. virtual int cap() const = 0; private: I AS (ASeq const &rhs); // Disabled. ASeq &operator(Aseq const &rhs); // Disabled. }; ASeq::ASeq(int cop) { } ASeq::-ASO {} Hondit #include "ASorter.hpp" of class InsertSorter : public Asorter { public: InsertSortero } protected: virtual void split(ASeq&, int lo, int &mid, int hi) override; virtual vold join CASeq&, int lo, int mid, int hi) override; }; X I x void InsertSorter::split(ASeq &, int, int Gnid, int h) { Il Post: mid == hi. mid - hi; x vold InsertSorter::Join(ASeq &a, int lo, int mid, int hi) { Il Pre: mid -- hi & sorted (o [lo..h1 - 11). 1/ Post: sorted (allo..hi]). cerr ::Join: Exercise for the student." #include "ASeq.hpp" // Asequence. using namespace std; class Asorter { public: void sort (ASeq &a, int lo, int ha); // Pre: &a, int lo, int &mid, int h) = 0; // Pre: lo }; void Asorter::sort (ASeq &a, int to, ant hi) { if (lo ::sort precondition failed." class Aseq { public: ASeq(int cap = 0); virtual -ASeg() = 0; virtual S &operator[](int i) = 0; // For read/write. virtual S const &operator[](int 1) const = 0; // For read-only. virtual int cap() const = 0; private: I AS (ASeq const &rhs); // Disabled. ASeq &operator(Aseq const &rhs); // Disabled. }; ASeq::ASeq(int cop) { } ASeq::-ASO {} Hondit #include "ASorter.hpp" of class InsertSorter : public Asorter { public: InsertSortero } protected: virtual void split(ASeq&, int lo, int &mid, int hi) override; virtual vold join CASeq&, int lo, int mid, int hi) override; }; X I x void InsertSorter::split(ASeq &, int, int Gnid, int h) { Il Post: mid == hi. mid - hi; x vold InsertSorter::Join(ASeq &a, int lo, int mid, int hi) { Il Pre: mid -- hi & sorted (o [lo..h1 - 11). 1/ Post: sorted (allo..hi]). cerr ::Join: Exercise for the student."