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.

Questions 251–260 of 1,079
  1. 251
  2. 252
  3. 253
  4. 254
  5. 255
  6. 256
  7. 257
  8. 258
  9. 259
  10. 260

Question 251

Multiple choice Sorting And Searching
Using inclusive bounds and floor midpoint, how many midpoint…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 252

Multiple choice Arrays
Return the count of even integers, including 0. 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 253

Multiple choice Arrays
For a nonempty array whose maximum-minus-minimum fits in int, return that difference. 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 254

Multiple choice Arrays
Return the centered average: remove exactly one smallest and one largest occurrence, then use integer division. Length≥3; sum fits in int. Which replacement for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 255

Multiple choice Arrays
Sum values, excluding every 13 and any value immediately after a13; empty input gives0. Sum fits in int. Which replacement for /* missing */ makes the method…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 256

Multiple choice Arrays
Sum the array except sections starting at a6 and ending at the next7 inclusive. Every 6 has a later7. Sum fits in int. Which replacement for /* missing */ makes…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 257

Multiple choice Arrays
Return true if a2 is adjacent to another2. Which replacement for /* missing */ makes the method meet its specification for all valid inputs? public boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 258

Multiple choice Arrays
Return true if there are no 1s and no 3s. Which replacement for /* missing */ makes the method meet its specification for all valid inputs?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 259

Multiple choice Arrays
Return true if the sum of all 2s is exactly8. 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 260

Multiple choice Arrays
Return true if the number of 1s exceeds the number of 4s. Which replacement for /* missing */ makes the method meet its specification for all valid inputs?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 251 of 1,079
Page 26 of 108