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 61–70 of 140
  1. 61
  2. 62
  3. 63
  4. 64
  5. 65
  6. 66
  7. 67
  8. 68
  9. 69
  10. 70

Question 61

Multiple choice Recursion
How many calls to t occur for t(6), including the initial call? // Precondition: n is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 62

Multiple choice Recursion
What value does f1(5,3) return? public int f1(int a,int b) { if(a==b)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 63

Multiple choice Recursion
Assuming mathematical integer arithmetic without overflow, what is z? public int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 64

Multiple choice Recursion
Consider the following method. public int loopy(int n) { if (n % 7 == 0) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 65

Multiple choice Recursion
Consider the following method. public int mystery(int n) { if (n <= 1) return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 66

Multiple choice Recursion
Consider the following method. public int guess(int num1, int num2) { if (num1 % num2 == 0) return (num2 + num1) / 2; return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 67

Multiple choice Recursion
Consider the following method. public int puzzle(int m, int n) { if (n == 1) return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 68

Multiple choice Recursion
Consider the following recursive method. public int weird(int num) { if (num <= 0) return num; return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 69

Multiple choice Recursion
Consider the following recursive method. public void wackyOutput (String wacky) { if (wacky.length() < 1) return; wacky =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 70

Multiple choice Recursion
Consider the following method. / * * @param x x >= 0 * / public void mystery(int x) { System.out.print(x % 10); if ((x / 10)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 61 of 140
Page 7 of 14