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 451–460 of 1,079
  1. 451
  2. 452
  3. 453
  4. 454
  5. 455
  6. 456
  7. 457
  8. 458
  9. 459
  10. 460

Question 451

Multiple choice Sorting And Searching
Consider the following method which implements an Insertion Sort algorithm. public void sortIt(int[] arr) { for (int i = 1;i < arr.length;i++) { int value =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 452

Multiple choice Arraylists
Consider the following method. public ArrayList<String> rearrange(ArrayList<String> myList) { for (int i = myList.size() / 2; i >= 0; i--) { String wordA =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 453

Multiple choice 2D Arrays
Consider the following code segment. int [] [] grid = { {0, 1, 2}, {3, 4, 5}, {6, 7, 8}, {9, 10, 11} }; int [] [] newGrid = new int [grid[0].length]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 454

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 455

Multiple choice Sorting And Searching
What can the following method best be described as? public int mystery(int[] array, int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 456

Multiple choice Arraylists
Assume obscureAnimals is an ArrayList<String> that has been correctly constructed and populated with the following items. ["okapi", "aye-aye", "cassowary",…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 457

Multiple choice Arraylists
Consider the following code segment. ArrayList<String> list = new ArrayList<String>(); list.add("P"); list.add("Q"); list.add("R");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 458

Multiple choice Arraylists
Consider the following instance variable and method. private ArrayList<Integer> nums; /** Precondition: nums.size > 0 */ public void numQuest() { int k = 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 459

Multiple choice Arrays
public class TimeRecord { private int hours; private int minutes; // 0<=minutes<60 public TimeRecord(int h, int m) { hours = h; minutes = m; } /** @return the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 460

Multiple choice Sorting And Searching
Consider the following instance variable and method. private int[] arr; /** Precondition: arr contains no duplicates; * the elements in arr are in sorted order.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 451 of 1,079
Page 46 of 108