Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Big Java Binder Early Objects
Quiz 14: Sorting and Searching
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 81
Multiple Choice
If a call to the Arrays static method binarySearch returns a value of -10, what can be concluded? I the element is not in the array II the element is at index 10 III the element can be inserted at index 9
Question 82
Multiple Choice
The ____ class contains a sort method that can sort array lists.
Question 83
Multiple Choice
Which of the following classes implement the Comparable interface? I Date II Collections III String
Question 84
Multiple Choice
The code segment below prints some of the elements in an array with size n. Select an expression to complete the code segment so that the resulting algorithm has O(log n) running time. for __________________________ { System.out.println(array[j]) ; }
Question 85
Multiple Choice
If you want to use the Comparable interface, you must implement a single method called ____.
Question 86
Multiple Choice
The code segment below displays a pattern of asterisks. Select an expression to complete the code segment so that the resulting algorithm has O(n) running time. for (int k = 0; k < n; k++) { For _______________________ { System.out.print("*") ; } System.out.println() ; }
Question 87
Multiple Choice
Given the following code snippet for searching an array: Int[] arr = {3, 8, 12, 14, 17}; Int newVal = 15; Int pos = Arrays.binarySearch(arr, newVal) ; What value will pos have when this code is executed?
Question 88
Multiple Choice
An algorithm that tests whether the first array element is equal to any of the other array elements would be an ____ algorithm.
Question 89
Multiple Choice
The method checkArray examines an array arr: public static boolean checkArray(int[] arr) { If (arr[0] >= arr[arr.length -1]) { Return true; } Return false; } What can you conclude about the running time of this section of code?