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 81–90 of 140
  1. 81
  2. 82
  3. 83
  4. 84
  5. 85
  6. 86
  7. 87
  8. 88
  9. 89
  10. 90

Question 81

Multiple choice Recursion
public int factors(int number) { return factors(number, number - 1, 0); } public int factors(int number, int check, int count) { if (number % check ==…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 82

Multiple choice Recursion
public int factors(int number) { return factors(number, number - 1, 0); } public int factors(int number, int check, int count) { if (number % check == 0) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 83

Multiple choice Recursion
What does function(24,3) return?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 84

Multiple choice Recursion
Consider this recursive problem. In elementary school, we learned that if you add up the digits of a number and get a sum of 9, then that number is divisible by…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 85

Multiple choice Recursion
Which algorithm is implemented? Assume array is sorted ascending. public static int mystery(int[] array,int a) { int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 86

Multiple choice Recursion
public void printSomething(String s) { int n = s.length(); if(n >= 1) { String s1 = s.substring(1,n); printSomething(s1);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 87

Multiple choice Recursion
Consider the following method: public void mystery(int a, int b) { System.out.print(a +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 88

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

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

Multiple choice Recursion
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 81 of 140
Page 9 of 14