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 691–700 of 1,222
  1. 691
  2. 692
  3. 693
  4. 694
  5. 695
  6. 696
  7. 697
  8. 698
  9. 699
  10. 700

Question 691

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 692

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 693

Free response Arraylists
In an International ballroom dancing competition, competitors are scored by a panel of judges on a scale from 0 to 100. The final score for each couple is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 694

Free response 2D Arrays
In chess, a queen can move vertically, horizontally, and diagonally on an 8-by-8 chessboard. The picture below shows all the positions on the board that a queen…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 695

Multiple choice 2D Arrays
int len = 4; int[][] matrix = new int[len][len]; int total = 0; for (int row = 0; row < len; row++) { total = total + matrix[row][1]; } Assume…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 696

Multiple choice Arraylists
Consider the following Java class field and method: private List<Integer> list; public void mystery(int n) { for (int i = 0; i < n; i++) { Object obj =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 697

Multiple choice Recursion
Consider the following method: public static int recur(int n) { if (n <= 1) return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 698

Multiple choice Arraylists
Consider the execution of the following Java code, which manipulates an ArrayList of strings: List<String> list = new ArrayList<String>(); list.add("a");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 699

Multiple choice 2D Arrays
Given the following method public void m(int[][] p) { int height = p.length; for (int row = 0;row < height / 2;row++) { for (int col =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 700

Multiple choice Recursion
Given the following recursive method: // precondition: x >= 0 public static void mystery(int x) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 691 of 1,222
Page 70 of 123