Verityprep
Question Bank · Unit 4

AP® Computer Science A Data Collections Practice Questions

Work through AP Computer Science A practice questions on Data Collections, then check each answer against a worked solution.

Free · no sign-up Open questions need no account. Sign up or log in to open the rest.

Subtopic: Sorting And Searching Clear filter

Questions 81–90 of 139
  1. 81
  2. 82
  3. 83
  4. 84
  5. 85
  6. 86
  7. 87
  8. 88
  9. 89
  10. 90

Question 81

Multiple choice Sorting And Searching
In the same1..100 game, the computer tests1,2,... and must actually…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 82

Multiple choice Sorting And Searching
A target is uniformly distributed over1..100. Sequential search submits1,2,...…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 83

Multiple choice Sorting And Searching
Consider the following method. public void mystery (int[] array) { for (int i = 1; i < array.length; i++) { int j; int key = array[i]; for (j = i - 1; j >= 0 &&…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 84

Multiple choice Sorting And Searching
A programmer intends to apply the standard Binary Search algorithm on the following array of integers. The standard Binary Search algorithm returns the index of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 85

Multiple choice Sorting And Searching
Consider the following sorting method. public void mysterySort(int[] arr) { for (int j = 1; j < arr.length; j++) { int temp = arr[j]; int index = j; while…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 86

Multiple choice Sorting And Searching
Consider the following method. public void selectionSort(String[] arr) { for (int i = 0; i < arr.length; i++) { int small = i; for (int j = i; j < arr.length;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 87

Multiple choice Sorting And Searching
Consider the following method which implements an Insertion Sort algorithm. public void sortIt(int[] arr) { for (int i = 1;i < arr.length;i++) { int value =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 88

Multiple choice Sorting And Searching
What can the following method best be described as? public int mystery(int[] array, int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 89

Multiple choice Sorting And Searching
Consider the following instance variable and method. private int[] arr; /** Precondition: arr contains no duplicates; * the elements in arr are in sorted order.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 90

Multiple choice Sorting And Searching
Often the most efficient computer algorithms use a divide-and-conquer approach, for example, one in which a list is repeatedly split into two pieces until a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 81 of 139
Page 9 of 14