Question: I have this header file and I need the implementation for several functions: retrieve, merge and isSubset. Thank you. class OrderedList : public List {

I have this header file and I need the implementation for several functions: retrieve, merge and isSubset. Thank you.

class OrderedList : public List

{

public:

static const int DEFAULT_MAX_LIST_SIZE = 10;

// Constructor

OrderedList ( int maxNumber = DEFAULT_MAX_LIST_SIZE );

// Modified (or new) list manipulation operations

virtual void insert ( const DataType &newDataItem ) throw ( logic_error );

virtual void replace ( const DataType &newDataItem ) throw ( logic_error );

bool retrieve ( const KeyType& searchKey, DataType &searchDataItem );

// Output the list structure -- used in testing/debugging

void showStructure () const;

// In-lab operations

void merge ( const OrderedList &other ) throw ( logic_error );

bool isSubset ( const OrderedList &other );

// Inheritance using templates is somewhat ugly in C++. It feels like you

// should be able to access base class member functions and data without the

// scope resolution operator. Sadly, you cannot when using templates.

// See http://www.parashift.com/c++-faq-lite/templates.html#faq-35.19

// Tell compiler to use these base class methods.

using List::remove;

using List::clear;

using List::isEmpty;

using List::isFull;

using List::gotoBeginning;

using List::gotoEnd;

using List::gotoNext;

using List::gotoPrior;

private:

// Locates an element (or where it should be) based on its key

bool binarySearch ( KeyType searchKey, int &index );

{

// Tell compiler to use these base class data members

using List::maxSize;

using List::cursor;

using List::size;

using List::dataItems;

};

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!