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
Get step-by-step solutions from verified subject matter experts
