Question: using the following partially defined intArrayList class class intArrayList { public: intArrayList& operator=(const intArrayList &); bool isEmpty()const; bool isFull()const; int listSize()const; int maxListSize()const; void print()const;

using the following partially defined intArrayList class

class intArrayList

{

public:

intArrayList& operator= (const intArrayList &);

bool isEmpty() const;

bool isFull() const;

int listSize() const;

int maxListSize() const;

void print() const;

void clearList();

int seqSearch(const int &item) const;

void insert(const int &insertItem);

void remove(const int &removeItem);

intArrayList(int size = 100);

intArrayList(const intArrayList &otherList);//copy constructor

~intArrayList();

protected:

int *list; //array to hold the list elements

int length; //to store the length of the list

int maxSize; //to store the maximum size of the list

};

a. Implement copy constructor. Explain why copy constructor is necessary?

b. Implement assignment operator overloading. Explain why it is necessary? Discuss its differences with copy constructor.

c. Implement insert function which puts an item which is not in the list. What is the order of the function?

d. Implement search function which queries an item in the list and returns the position. What is the order of the function?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

heres the implementation of the remaining functions of the intArrayList class along with explanations for copy constructor and assignment operator overloading a Copy Constructor Implementation and Exp... View full answer

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 Programming Questions!