// Definition of copy constructor // Instructions omitted intentionally. // Your code
class Node {
public: Node() : data(0), prev(nullptr), next(nullptr) {}
Node(int theData, Node* prevLink, Node* nextLink) : data(theData), prev(prevLink), next(nextLink) {}
int getData() const { return data; }
Node* getPrev() const { return prev; }
Node* getNext() const { return next; }
void setData(int theData) { data = theData; }
void setPrev(Node* prevLink) { prev = prevLink; }
void setNext(Node* nextLink) { next = nextLink; }
~Node(){}
private: int data;
Node* prev;
Node* next;
};
class AnyList {
// friend function overloads the insertion operation
public:
// copy constructor
// overloaded assignment operator
// other member functions not necessary for your implementation
private:
Node *first;
Node *last;
int count;
};
please help write copy constructor
#include "AnyList.h"
#include <iostream>
using namespace std;
// Definition of copy constructor
// Instructions omitted intentionally.
// Your code

Trending now
This is a popular solution!
Step by step
Solved in 2 steps









