Question
Implement the following classes in the UML: 1. List class includes: constructor List(): Create an empty list with a length of 100. Hint : double
Implement the following classes in the UML:
1. List class includes:
constructor List(): Create an empty list with a length of 100. Hint: double [] list = new double [100];
constructor List(len: int): Create a List with a user specified maximum length. Hint: double [] list = new double [len];
add: add a new element to the end of the unsorted list.
print: display the list
2.SortedList class includes
two constructors : similar to the constructors in List,
add: add a new element into the ascending sorted list.
3.TestProgram: main method creates a genera list (unsorted) and a sorted list with random numbers using add methods; display the unsorted and sorted lists.
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