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 BinarySearch) and Sort ) methods have i

ID: 3707733 • Letter: 1

Question

17. Which of the following traits do the BinarySearch) and Sort ) methods have in common? a. Both methods take a single argument that must be an array. b. Both methods belong to the SystemArray 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 BinarySearch) method and the object you seek is not found in the array, 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 Binarysearch) 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, vou want to find an exact match for a value d. array items are not numeric 20. Which of the following declares an integer array that contains eight rows and five columns? b.?nt [8] [5] num = new int[]; d. hnt [ , ] num = new int. [8 , 5);

Explanation / Answer

17.

b) Both method belongs to the system.Array class

Description:

System.Arrays.Sort()

System.Arrays.BinarySearch()

Both belongs to the arrays class.

18.

d) a negative value is returned

Description:

Once the searched object does not present in the array then a negative value will be displayed , its a common behaviour.               

19.

b) Array holds the binary values and you have to find them all

Description:

It is impossible to find all values when there are duplicate values present in binary search.

20.

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

Description:

This is the default syntax used in array creation of integer with 8 rows and five columns.

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