CSS 143 h. Selection sort works by repeatedly i. using the position of elements
ID: 3728566 • Letter: C
Question
CSS 143 h. Selection sort works by repeatedly i. using the position of elements to split the list into two sublists of equal size ii. finding the smallest element in the remainder of the list and moving it forward comparing adjacent elements in the list and swapping them if they are out of order iv. using a threshold value to split the list into two sublists where one sublist's elements are greater than the threshold and the other sublist's elements are less than the threshold i. A private instance variable i. can never be modified by a method outside the class i. can be modified by a method outside the class if it is returned by a methoc ili. can be modified by a method outside the class if it is a class type, using a mutator method (assuming one exits) can be modified by using an object name followed by a dot and then the name of the instance variable iv. j. What is the output of the following code segment: TreeSetString> nap-new TreeSet; map. add ("one") map.add ("two") map.addf"three") map.addl"four") ap. add("one"): Iterator it -map.iterator) while (it.hasNexto System.out.print( it.next()+" one two three four i. il. four three two one ii. one two three four one four one three two iv.Explanation / Answer
h. ii) finding the smallest element in the remainder of the list and moving it forward
i. iii) can be modified by a method outside the class if it is a class type, using a mutator method (assuming one exits)
j. iv) four one three two