You never really understood why there had to be so many different kinds of colle
ID: 3867293 • Letter: Y
Question
You never really understood why there had to be so many different kinds of collections in Java, so you decide to test various collections (ArrayList, LinkedList, and set-implemented using HashSet) to see if you can detect any difference between them. You remember hearing that some of the differences are only readily apparent when you are working with very large collections so you write the following core code to create your collection (described on pseudocode)
For I from 0 to 100,000;
Generate a random value between 1 and 100, inclusive
Add the value to each your collections
Answer the following questions related to the characteristics and behavior of each Of your collections(you have named your collection objects myArrayList, myLinkedList, and mySet)
Question10. List the numbers of elements in each collection(I.e number items in each coloection):
a-myArrayList:
b-myLinkedList:
c- mySet:
Question11. select from the following possibilities when answering the questions below:
a-None
b-Once
c-Approximately 100
d-Approximately 1000
e-Approximately 10,000
Explanation / Answer
Answer for the given question:
Q10:Answer is myArrayList:
Which will store the all the values generated between 1 to 100
Q 11: Approximately 10,000
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.