Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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.
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
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."

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions