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,531–2,540 of 3,140
  1. 2531
  2. 2532
  3. 2533
  4. 2534
  5. 2535
  6. 2536
  7. 2537
  8. 2538
  9. 2539
  10. 2540

Question 2531

Multiple choice Unit 4: Data Collections
Consider the following class: public class ArraySorter { public static void sort(int[] arr) { for (int i = 0; i < arr.length; i++) { for (int j = arr.length -…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2532

Multiple choice Unit 4: Data Collections
Merge sort takes about18ms for80000 random values and40ms for160000. Which…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2533

Multiple choice Unit 4: Data Collections
The Binary Search algorithm is designed to work with an array sorted in ascending order. Under which of the following circumstances will the algorithm find a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2534

Multiple choice Unit 4: Data Collections
What is printed when the code segment is executed? ArrayList<Integer> lst = new ArrayList<Integer>(); int k = 2; while (lst.size() <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2535

Multiple choice Unit 4: Data Collections
Consider the following three implementations of a method rotate90Degrees and the code segments used to test them. I. public int[] rotate90Degrees(int[] v) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2536

Multiple choice Unit 4: Data Collections
String[] a = {"A", "B"}; String[] b = a; String[] c = {a[0], a[1]}; String letter = a[0]; a[0] = a[1]; a[1] =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2537

Multiple choice Unit 4: Data Collections
What is the value of v[4] after the following code segment is executed? int d = 1;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2538

Multiple choice Unit 4: Data Collections
Consider the following method. public void splat(String s) { if (s.length() < 8)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2539

Multiple choice Unit 4: Data Collections
Consider the following method. public void printVals(String[] items, int k) { if (k > 1) { printVals(items, k - 1); System.out.print(items[k] + " ");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2540

Multiple choice Unit 4: Data Collections
Consider the following method. public void printVals(String[] items, int k) { if (k > 1) { printVals(items, k - 1); System.out.print(items[k] + " ");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,531 of 3,140
Page 254 of 314