#ifndef CONTAINER_H #define CONTAINER_H using namespace std; class container { public: // CONSTRUCTOR container(); ~container(); container(const container& c); container& operator=(const container& c) // MEMBER FUNCTIONS bool...

50.1K

Verified Solution

Question

Programming

#ifndef CONTAINER_H

#define CONTAINER_H

using namespace std;

class container {

public:

// CONSTRUCTOR

container();

~container();

container(const container& c);

container& operator=(const container& c)

// MEMBER FUNCTIONS

bool lookup(const int& target);

void remove(const int& target);

void add(const int& target); private:

struct node{

int key;

node *next;

};

node* head;

node* tail;

};

#endif

For a linked list based implementation of a container classshown above, implement the constructor, copy constructor,destructor and copy assignment functions.

Answer & Explanation Solved by verified expert
4.5 Ratings (989 Votes)
Here is the completed code for these four methods Comments are included go through it learn how things work and let me know if you have any doubts or if you need anything to change If you are satisfied with the solution please rate the    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students