Verityprep
Question Bank

AP® Computer Science A Practice Questions

Work through AP Computer Science A practice questions unit by unit, 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.

Questions 2,311–2,320 of 3,140
  1. 2311
  2. 2312
  3. 2313
  4. 2314
  5. 2315
  6. 2316
  7. 2317
  8. 2318
  9. 2319
  10. 2320

Question 2311

Multiple choice Unit 4: Data Collections
With the bounds-safe repair shown, which ordering precondition makes search correct…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2312

Multiple choice Unit 4: Data Collections
For key27, what inclusive interval remains after the first loop iteration? private int[] a; // Precondition: a is sorted in ascending order. public int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2313

Multiple choice Unit 4: Data Collections
How many loop iterations determine that27 is absent? private int[] a; // Precondition: a is sorted in ascending order. public int binSearch(int key) { int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2314

Multiple choice Unit 4: Data Collections
What is y after int y=binSearch(4)? private int[] a; // Precondition: a is sorted in ascending order. public int binSearch(int key) { int low=0,high=a.length-1;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2315

Multiple choice Unit 4: Data Collections
If the condition changes to low<high, which listed existing value is missed? private int[] a; // Precondition: a is sorted in ascending order. public int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2316

Multiple choice Unit 4: Data Collections
After each unsuccessful iteration of binSearch, which is a safe loop invariant? private int[] a; // Precondition: a is sorted in ascending order. public int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2317

Multiple choice Unit 4: Data Collections
A successful binary search on about30000 sorted elements must be…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2318

Multiple choice Unit 4: Data Collections
For [1,7,9,5,4,12], what is the result after the third outer-loop pass? private Integer[] a; public void insertionSort() {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2319

Multiple choice Unit 4: Data Collections
Which input requires the fewest executions of a[j+1]=a[j] while sorting descending? private Integer[] a; public void…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2320

Multiple choice Unit 4: Data Collections
Which input requires the most executions of a[j+1]=a[j] while sorting descending? private Integer[] a; public void…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,311 of 3,140
Page 232 of 314