Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The lists are used in the following THREE problems The list object wList consist

ID: 3602374 • Letter: T

Question

The lists are used in the following THREE problems The list object wList consists of words ever just the same ever a surprise ever as before ever just as sure as the sun will 19. What is the size of the following set created by code Set wsot -now HashSetcstring? (wList) 20. The set-set is from #19. What is the output? for (String w: wSat) if (w.length O>3) System.out.println (w) 1. What is the content of the final wList after processing the following? for (String w: wList) ( if (w. length 0>3) wList.remove (w) wList.remove (wList.size)-1) Collections.sort (wList): is the worst number of comparisons? ng selection sort to sort 7 elements

Explanation / Answer

(19 ) HashSet will have non duplicate elements

ever, just , the , same , a, suprise, as , before, sure, sun , will

Size will be 11

(20)
Length greater than 3

Output will be : ever, just , same, surprise, beforem sure, will

21) First remove from list all string of length greater than 3

the, a, as , as, as, the, sun

remove last entry ie sun

the, a, as , as, as, the

Then Sort the content

a , as, as, as, the , the


22) . Worst case comparision of selection sort is O(n2)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote