Question
A set is a collection of distinct element of the same type. Design the class unorderedSetType, derived from the unorderedArrayListType, to manipulate sets. Note that
A set is a collection of distinct element of the same type. Design the class unorderedSetType, derived from the unorderedArrayListType, to manipulate sets. Note that you need to redefine only the functions insertAt, insertEnd, and replaceAt. If the item to be inserted is already in the list, the functions insertAt and insertEnd output an appropriate message. Similarly, if the item to be replaced is already in the list, the function replaceAt outputs and appropriate message. Also, write a program to test your class.
Derivationderive unorderedSetType from unorderedArrayListType | 2 pts | |
This criterion is linked to a Learning OutcomeinsertAt1) invokes base class to make sure item is not already in list 2) invokes base class method to insert item into list | 2 pts | |
This criterion is linked to a Learning OutcomeinsertEndinsertEnd invokes insertAt to insert an item at the end of the set. | 2 pts | |
This criterion is linked to a Learning OutcomereplaceAt1) makes sure replaceAt position is in range 2) makes sure replaceAt item is not already in structure 3) replaces old item with new item | 2 pts | |
This criterion is linked to a Learning Outcomemain functionmain function tests insertAt, insertEnd, replaceAt |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started