Verityprep
Question Bank · Unit 4

AP® Computer Science A Data Collections Multiple Choice Questions

Work through AP Computer Science A multiple-choice 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: Recursion Clear filter

Questions 101–110 of 140
  1. 101
  2. 102
  3. 103
  4. 104
  5. 105
  6. 106
  7. 107
  8. 108
  9. 109
  10. 110

Question 101

Multiple choice Recursion
Given the following code: public static int mystery(String str) { if (str.length() == 0) return 1; else { if (str.substring(0,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 102

Multiple choice Recursion
Consider the following method: public static int recur(int n) { if (n <= 1) return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 103

Multiple choice Recursion
Given the following recursive method: // precondition: x >= 0 public static void mystery(int x) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 104

Multiple choice Recursion
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 105

Multiple choice Recursion
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 106

Multiple choice Recursion
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 107

Multiple choice Recursion
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 108

Multiple choice Recursion
Consider the following method: public static int m1(int a) { if (a == 1)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 109

Multiple choice Recursion
Consider the following Java class: public class Searcher { private int[] arr = {1, 3, 5, 8, 9}; public int mystery(int low, int high, int num) { int mid = (low…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 110

Multiple choice Recursion
Consider the following recursive method: // precondition: x >= 0 public static void mystery(int x) { if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 101 of 140
Page 11 of 14