Could you please help. Needs to be in C++. - implement the LinkedList ADT [modify ListLinked.cpp] - implement the following operations: - constructor, copy constructor,
Could you please help. Needs to be in C++.
- implement the LinkedList ADT [modify ListLinked.cpp]
- implement the following operations:
- constructor, copy constructor, assignment operator, destructor; and
- inser
I will include the header file which shows the definitions and the cpp file that needs to be implemented. Please do the implementations on the cpp file.
listlinked.h
//-------------------------------------------------------------------- // // Laboratory 5 ListLinked.h // // Class declaration for the linked implementation of the List ADT // //--------------------------------------------------------------------
#ifndef LISTLINKED_H #define LISTLINKED_H
#pragma warning( disable : 4290 )
#include
using namespace std;
template
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);
// Programming exercise 2 void moveToBeginning () throw (logic_error);
// Programming exercise 3 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;
};
#endif
listlinked.cpp
#include "ListLinked.h"
// ListNode member functions
template
// List member functions
template
template
template
template
template
template
template
template
template
template
template
template
template
template
template
template
template
#include "show5.cpp"
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started