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 671–680 of 1,079
  1. 671
  2. 672
  3. 673
  4. 674
  5. 675
  6. 676
  7. 677
  8. 678
  9. 679
  10. 680

Question 671

Multiple choice Sorting And Searching
Consider the following array: {7, 3, 8, 5, 2} Which of the following correctly…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 672

Multiple choice 2D Arrays
Given the following 2D array m: Row 0: 1 1 1 1 Row 1: 1 2 3 4 Row 2: 2 2 2 2 Row 3: 2 4 6 8 Consider the following code segment: int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 673

Multiple choice Arrays
Consider the following method: public static boolean test(int[] a, int val) { boolean temp = false; for (int i = a.length-1; i >= 0; i--)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 674

Multiple choice Recursion
Consider the following method: public static int m1(int a) { if (a == 1)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 675

Multiple choice Recursion
Consider the following Java class: public class Searcher { private int[] arr = {1, 3, 5, 8, 9}; public int mystery(int low, int high, int num) { int mid = (low…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 676

Multiple choice Sorting And Searching
The following incomplete method is intended to sort the array elem in ascending order using the selection sort algorithm. public static void sort(int[] elem) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 677

Multiple choice 2D Arrays
Consider the following code segment: int[][] mat = new int[3][4]; for (int row = 0;row < mat.length;row++) { for (int col = 0;col < mat[0].length;col++) { if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 678

Multiple choice Arrays
Given the following method: public int test(int v) { for (int i = 0; i < a.length; i++) { if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 679

Multiple choice Arrays
Consider the following code that is part of a class declaration: private int[] myStuff; // precondition: myStuff contains integers in no particular order public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 680

Multiple choice Arraylists
Consider the following declaration of the class RandomList, which has a constructor intended to initialize the instance variable numList to an ArrayList of n…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 671 of 1,079
Page 68 of 108