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,621–2,630 of 3,140
  1. 2621
  2. 2622
  3. 2623
  4. 2624
  5. 2625
  6. 2626
  7. 2627
  8. 2628
  9. 2629
  10. 2630

Question 2621

Multiple choice Unit 4: Data Collections
Given the following 2D array declaration and initialization: int[][] matrix = {{-1, -2, 3}, {4, -5, 6}}; And the method: public static void changeMatrix(int[][]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2622

Multiple choice Unit 4: Data Collections
Consider the following recursive method: public static int mystery(int n) { if (n == 0)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2623

Multiple choice Unit 4: Data Collections
Given the initial array: {6, 3, 8, 5, 1} Which of the following correctly shows…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2624

Multiple choice Unit 4: Data Collections
Given the following recursive method: public static int mystery(String str) { if (str.length() == 0) return 0; else { if (str.substring(0,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2625

Multiple choice Unit 4: Data Collections
Which scenario will cause the longest execution time for a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2626

Multiple choice Unit 4: Data Collections
Consider the following code segment: public static void test(int[] a, int y) { if (a.length > 1) { a[1] = a[1] * 2; y…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2627

Multiple choice Unit 4: Data Collections
Which of the following is (are) true? I. Insertion sort takes longer when the array is sorted in ascending order and you want it sorted in…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2628

Multiple choice Unit 4: Data Collections
Consider the following code segment: private int[] arr; public int mystery(int low, int high, int num) { int mid = (low + high) / 2; if (low > high) { return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2629

Multiple choice Unit 4: Data Collections
Consider the following code segment: ArrayList<String> list1 = new ArrayList<String>(); list1.add("a"); list1.add("b"); list1.add(0, "c");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2630

Multiple choice Unit 4: Data Collections
Consider the following recursive method: public static int mystery(String str) { if (str.length() == 1) return 0; else { if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,621 of 3,140
Page 263 of 314