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 31–40 of 140
  1. 31
  2. 32
  3. 33
  4. 34
  5. 35
  6. 36
  7. 37
  8. 38
  9. 39
  10. 40

Question 31

Multiple choice Recursion
What is the base case…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 32

Multiple choice Recursion
Why do we…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 33

Multiple choice Recursion
Of the following problems, which one…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 34

Multiple choice Recursion
Given the following code, how many calls (including the original call) to the printX method would be made if we called…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 35

Multiple choice Recursion
Starting at a valid index, can a subset sum to target? Any element may be chosen or omitted; sums stay within int. Which replacement for /* missing */ makes the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 36

Multiple choice Recursion
Find a target-sum subset, but every 6 must be included. Which replacement for /* missing */ makes the method meet its specification for all valid inputs? public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 37

Multiple choice Recursion
Can a subset sum to target if no two chosen indices are adjacent? Which replacement for /* missing */ makes the method meet its specification for all valid…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 38

Multiple choice Recursion
Every multiple of 5 must be chosen; a1 immediately after such a multiple must be omitted. Other values are optional. Which replacement for /* missing */ makes…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 39

Multiple choice Recursion
Adjacent equal values form a clump that must be included all together or excluded all together. Which replacement for /* missing */ makes the method meet its…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 40

Multiple choice Recursion
Partition every element into one of two groups with equal sums. No loops are needed. Which replacement for /* missing */ makes the method meet its specification…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 31 of 140
Page 4 of 14