Verityprep
Question Bank

AP® Computer Science A Multiple Choice Questions

Work through AP Computer Science A multiple-choice 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,031–2,040 of 2,811
  1. 2031
  2. 2032
  3. 2033
  4. 2034
  5. 2035
  6. 2036
  7. 2037
  8. 2038
  9. 2039
  10. 2040

Question 2031

Multiple choice Unit 4: Data Collections
Return the length of the largest contiguous section appearing somewhere in reverse order; overlap is allowed. Which replacement for /* missing */ makes the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2032

Multiple choice Unit 4: Data Collections
A clump is a maximal run of at least two equal adjacent values. Return the clump count. 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 2033

Multiple choice Unit 4: Data Collections
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 2034

Multiple choice Unit 4: Data Collections
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 2035

Multiple choice Unit 4: Data Collections
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 2036

Multiple choice Unit 4: Data Collections
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 2037

Multiple choice Unit 4: Data Collections
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 2038

Multiple choice Unit 4: Data Collections
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 2039

Multiple choice Unit 4: Data Collections
Partition all elements into two groups: one sum divisible by 10 and the other odd. Negative odd sums qualify. Which replacement for /* missing */ makes the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2040

Multiple choice Unit 4: Data Collections
Partition all values into equal-sum groups, with every multiple of 5 forced into group a, and every multiple of 3 that is not a multiple of 5 forced into b.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,031 of 2,811
Page 204 of 282