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

17. Which of the following traits do the BinarySearsh ) and Sort ) methods have

ID: 3708389 • Letter: 1

Question

17. Which of the following traits do the BinarySearsh ) and Sort ) methods have in common? a. Both methods take a single argument that must be an array. b. Both methods belong to the syatem.Array class. c. The array that each method uses must be in ascending order. d. They both operate only on arrays made up of numeric data. 18. Ifyou use the BinaxySearsh () method and the object you seek is not found in the array,K a. an error message is displayed b. a zero is returned c. the value false is returned d. a negative value is returned 19. The Binarzseaxsh) method is inadequate when a. array items are in ascending order b. the array holds duplicate values and you want to find them all c. you want to find an exact match for a value d. array items are not numeric 20. Which ofthe following declares an integer array that contains eight rows and five columns? a. intl8, 5] aum - new intl , 1; b. int [8] [5] num-new int[];

Explanation / Answer

Answer 17: b) Both methods belong to the System.Array class.

BinarySearch() arrays take two arguments. Sort() arrays do not have to be in ascendingorder to start. They both work on class objects. System.Arrays.Sort() and System.Arrays.BinarySearch() both belongs to the arrays class.

Answer 18: d) a negative value is returned.

A negative value is returned if the searched objec does not present in the array.

Answer 19: b) the array holds duplicate values and you want to find them all.

Answer 20: d) int [ , ] num = new int [ 8 ,5 ] ;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote