Verityprep
Question Bank · Unit 4

AP® Computer Science A Data Collections Practice Questions

Work through AP Computer Science A practice 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: Arrays Clear filter

Questions 101–110 of 341
  1. 101
  2. 102
  3. 103
  4. 104
  5. 105
  6. 106
  7. 107
  8. 108
  9. 109
  10. 110

Question 101

Multiple choice Arrays
Return true if a1 has a2 somewhere later. 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 102

Multiple choice Arrays
Return true if any three adjacent values are all even or all odd. 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 103

Multiple choice Arrays
Return true if exactly three3s occur and no two are adjacent. 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 104

Multiple choice Arrays
Return true if every 2 has another2 immediately before or after it. 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 105

Multiple choice Arrays
For 0≤len≤nums.length, return whether the first len values equal the last len values in the same order. Which replacement for /* missing */ makes the method…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 106

Multiple choice Arrays
Return true if an adjacent triple increases by exactly1 each time. Arithmetic is within int range. 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 107

Multiple choice Arrays
For end≥start, return the integers from start inclusive to end exclusive. The length fits in int. 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 108

Multiple choice Arrays
Rotate left by one; empty input remains empty. Which replacement for /* missing */ makes the method meet its specification for all valid inputs? public int[]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 109

Multiple choice Arrays
Propagate each encountered multiple of 10 through later nonmultiples until another multiple of 10 is reached. Which replacement for /* missing */ makes the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 110

Multiple choice Arrays
The nonempty array contains a4. Return a new array of all elements before the first 4. 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 101 of 341
Page 11 of 35