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 561–570 of 1,079
  1. 561
  2. 562
  3. 563
  4. 564
  5. 565
  6. 566
  7. 567
  8. 568
  9. 569
  10. 570

Question 561

Multiple choice Sorting And Searching
Array arr2 has been defined and initialized as follows. int[] arr2 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; If the array is being searched for the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 562

Multiple choice Recursion
public int factors(int number) { return factors(number, number - 1, 0); } public int factors(int number, int check, int count) { if (number % check ==…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 563

Multiple choice Recursion
public int factors(int number) { return factors(number, number - 1, 0); } public int factors(int number, int check, int count) { if (number % check == 0) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 564

Multiple choice Recursion
What does function(24,3) return?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 565

Multiple choice Recursion
Consider this recursive problem. In elementary school, we learned that if you add up the digits of a number and get a sum of 9, then that number is divisible by…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 566

Multiple choice Recursion
Which algorithm is implemented? Assume array is sorted ascending. public static int mystery(int[] array,int a) { int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 567

Multiple choice Recursion
public void printSomething(String s) { int n = s.length(); if(n >= 1) { String s1 = s.substring(1,n); printSomething(s1);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 568

Multiple choice Arrays
Consider the following code segment: int[] a = {0, 1}; int[] b = a; a[0] = 1; b[0] = 2;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 569

Multiple choice Recursion
Consider the following method: public void mystery(int a, int b) { System.out.print(a +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 570

Multiple choice Arrays
Consider the following method: /** * Precondition: a != null; a.length > 0 */ private static void doIt(double[] a) { for (int k = 0; k < a.length / 2; k++)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 561 of 1,079
Page 57 of 108