Question: Use C++ language to solve the following data structure and algorithm problem Summary Lists are copied all the time and we expect them to work
Use C++ language to solve the following data structure and algorithm problem
Summary
Lists are copied all the time and we expect them to work correctly. Sometimes, we expect that any modification on the original or the copy of the list will be synchronized (e.g. address books on phone, web, car, etc.). Other times, we expect that the original and the copy are de-coupled(distinct/disconnected)such that changes to one wont affect the other (e.g. file backups to the cloud). This homework explores these concepts accordingly.
Skills Expected
Skills from previous assignments
Abstract class and overrides
Copy constructor and Inherited parameterized constructors
Assignment Description
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 the implementation).
You are then expected to have a SoftCopyList child class and a HardCopyList 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.)
Notes:
0 points if code doesnt compile.
Up to half points taken off if theres no separation between .h and .cpp files or if the list contains only fundamental data types
Up to 3 points deduction if invariants are not enforced.
Up to 1 point deduction if code isnt readable.
Grading Criteria
Abstract list class
o[1 Point] Parameterized constructor to add the first item to the list
o[1 Point] Pure virtual copy constructor
o[3Points] Implementation of basic list interface (e.g. add, remove, find)
o[3Points] Implementation of a comparison operator overload ( == overload)
SoftCopyList child class
o[1 Point] Parameterized constructor inheritance implementation
o[2 Points] soft copy constructor
HardCopyList child class
o[1 Point] Parameterized constructor inheritance implementation
o[3 Points] hard copy constructor
[2Points] 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 the destructor is called.
Demonstration (driver):
[1 Point] A SoftCopyList with ~10 data
[1 Point] A copy of the SoftCopyList using the copy constructor
[1 Point] Make a change to the original SoftCopyList and demonstrate that the original and copy of instances are the same using the comparison operator overload
[1 Point] A HardCopyList with ~10 data (may reuse the same data as from SoftCopyList)
[1 Point] A copy of the HardCopyList using the copy constructor
[1 Point] Make a change to the original HardCopyList and demonstrate that the original and copy instances are different using the comparison operator overload
Big-O Analysis:
[1 Point] Is the Big O different for hard copy vs. soft copy?
[1 Point] What is the Big O of your destructor
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
