Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C + + , Create a list class named 'List'. Implement this class using a dynamic array. The initial size of the dynamic array

Using C++, Create a list class named 'List'. Implement this class using a dynamic array. The initial size of the dynamic array is to be 2. If the array is ever full when an insert operation is called, you are to add 2 to the size of the array.
Write a small main program to test your List class with the following menu:
Insert (value to be inserted is entered from keyboard)
Remove (value to be removed entered from keyboard, remove first occurrence if one exists and shift other items to the left so as to not leave a blank slot)
Print List (all values, one per line)
Quit
After you have everything working, derive a class named Set from List. A Set is like a List but does not allow duplicate values to be stored. Change the main program so that you ask the user at the beginning of the program if they want to use a List or a Set. Proceed with the main program as I outlined before with whichever type they choose.
image text in transcribed

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

Spatial Databases With Application To GIS

Authors: Philippe Rigaux, Michel Scholl, Agnès Voisard

1st Edition

1558605886, 978-1558605886

More Books

Students also viewed these Databases questions