Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ You are expected to create a broad list abstract class with a purely virtual copy constructor. While the implementation of the list is open

C++

You are expected to create a broad list abstract class with a purely virtual copy constructor. While the implementation of the list is open to you at this time (i.e. you may use Vector, STL, etc.), you may find it useful to still define your own Node class with its own copy constructor (not required youre free to experiment on theimplementation). You are then expected to have a ShallowCopyList child class and a DeepCopyList child class from the abstract list class that overrides the copy constructor properly. The list must contain a non-fundamental data type (e.g. Music, Address, etc.)

Abstract list class o [1 Point] Parameterized constructor to add the first item to the list o [1 Point] Pure virtual copy constructor o [3 Points] Implementation of basic list interface (e.g. add, remove, find) o [3 Points] Implementation of a comparison operator overload ( == overload)

ShallowCopyList child class o [1 Point] Parameterized constructor inheritance implementation

o [2 Points] shallow copy constructor

DeepCopyList child class o [1 Point] Parameterized constructor inheritance implementation

o [3 Points] deep copy constructor

[2 Points] On one or more of the class definitions above, implement a destructor that deletes all items in the list as appropriate. Provide justification in comments as to why its appropriate to delete everything in the list when destructor is called.

Demonstration (driver):

o [1 Point] A ShallowCopyList with ~10 data o [1 Point] A copy of the ShallowCopyList using the copy constructor

o [1 Point] Make a change to the original ShallowCopyList and demonstrate that the original and copy of instances are the same using the comparison operator overload o [1 Point] A DeepCopyList with ~10 data (may reuse the same data as from ShallowCopyList) o [1 Point] A copy of the DeepCopyList using the copy constructor

o [1 Point] Make a change to the original DeepCopyList and demonstrate that the original and copy instances are different using the comparison operator overload

Big-O Analysis:

o [1 Point] Is the Big O different for deep copy vs. shallow copy?

o [1 Point] What is the Big O of your destructor?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions

Question

Explain the guideline for job description.

Answered: 1 week ago

Question

What is job description ? State the uses of job description.

Answered: 1 week ago

Question

What are the objectives of job evaluation ?

Answered: 1 week ago

Question

Write a note on job design.

Answered: 1 week ago

Question

=+ How well do you think you could do your job?

Answered: 1 week ago