Question: using c++ implement the following operations: template class List { public: List(int ignored = 0); List(const List& other); List& operator=(const List& other); ~List(); void insert(const

using c++

implement the following operations:

template class List { public: List(int ignored = 0); List(const List& other); List& operator=(const List& other); ~List();

void insert(const DataType& newDataItem) throw (logic_error); void remove() throw (logic_error); void replace(const DataType& newDataItem) throw (logic_error); void clear();

bool isEmpty() const; bool isFull() const;

void gotoBeginning() throw (logic_error); void gotoEnd() throw (logic_error); bool gotoNext() throw (logic_error); bool gotoPrior() throw (logic_error);

DataType getCursor() const throw (logic_error);

void moveToBeginning () throw (logic_error);

void insertBefore(const DataType& newDataItem) throw (logic_error); void showStructure() const;

private: class ListNode { public: ListNode(const DataType& nodeData, ListNode* nextPtr);

DataType dataItem; ListNode* next; };

ListNode* head; ListNode* cursor;

};

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!