Verityprep
Question Bank

AP® Computer Science A Practice Questions

Work through AP Computer Science A practice 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,301–2,310 of 3,140
  1. 2301
  2. 2302
  3. 2303
  4. 2304
  5. 2305
  6. 2306
  7. 2307
  8. 2308
  9. 2309
  10. 2310

Question 2301

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

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

Multiple choice Unit 4: Data Collections
Which factors matter when choosing a sorting algorithm? I:…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2304

Multiple choice Unit 4: Data Collections
What safely completes a left-to-right search that returns the matching index…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2305

Multiple choice Unit 4: Data Collections
Which property lets binary search discard a half,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2306

Multiple choice Unit 4: Data Collections
For the best standard algorithms on random-access arrays, which operation has a better worst-case asymptotic time bound on sorted…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2307

Multiple choice Unit 4: Data Collections
A sorted-array search probes every third element from the front, then checks up to two preceding entries in the first…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2308

Multiple choice Unit 4: Data Collections
For a nonempty array,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2309

Multiple choice Unit 4: Data Collections
Assuming a is nonempty, when does this code definitely fail its intended…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2310

Multiple choice Unit 4: Data Collections
For [89,42,−3,13,109,70,2], what is the array after the third outer-loop pass of descending selection sort? public class Sorter { private Integer[] a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,301 of 3,140
Page 231 of 314