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.

Questions 51–60 of 1,222
  1. 51
  2. 52
  3. 53
  4. 54
  5. 55
  6. 56
  7. 57
  8. 58
  9. 59
  10. 60

Question 51

Multiple choice Recursion
What is the output from mystery(4321) when mystery is defined as follows: //precondition: x >=0…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 52

Multiple choice Sorting And Searching
Which of the following correctly shows the iterations of an ascending (from…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 53

Multiple choice Recursion
Consider the following code segment: public static boolean check(String s) { return s.length() >= 2 &&…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 54

Multiple choice 2D Arrays
A two-dimensional array is used to represent a matrix. The declaration is below: private int[][] matrix = new int[2][3]; public static void changeMatrix(int[][]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 55

Multiple choice Sorting And Searching
What is printed when the following main method is executed? public class Searcher { private int[] arr = {1,3,5,8,9}; public int mystery(int low, int high, int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 56

Multiple choice Recursion
Consider the following method. What value is returned from a call of mystery(5)?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 57

Multiple choice Sorting And Searching
Which of the following correctly shows the iterations of an ascending (from…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 58

Multiple choice Recursion
Given the following code: public static int mystery(String str) { if (str.length() == 0) return 1; else { if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 59

Multiple choice Sorting And Searching
Which of the following is (are) true? I. Insertion sort takes longer when the array is sorted in ascending order and you want it sorted in…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 60

Multiple choice 2D Arrays
Given the following values for a 2D array m and the following code 1 1 1 1 1 2 3 4 2 2 2 2 2 4 6 8 int sum = 0; for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 51 of 1,222
Page 6 of 123