
APCSA MCQPacket Unit 7-10

Flashcard
•
Computers
•
11th Grade
•
Hard
Wayground Content
FREE Resource
Student preview

34 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Consider the following code segment. What is printed as a result of executing the code segment? Options: , , , , Nothing is printed because the first print statement will cause an error.
Back
2.
FLASHCARD QUESTION
Front
Refer to the static method removeNegs shown below. For which of the following lists will the method not work as intended? 6 -1 -2 5, -1 2 -3 4, 2 4 6 8, -3, 1 2 3 -8
Back
6 -1 -2 5
3.
FLASHCARD QUESTION
Front
Consider a sorted array arr of n elements, where n is large and n is even. Under which conditions will a linear search of arr be faster than a binary search? I. The target is not in the list. II. The target is in the first position of the list. III. The target is in arr [l + n/2]
Back
II only
4.
FLASHCARD QUESTION
Front
Let list be an ArrayList<String> containing only these elements: “Alex”, “Emma”, “John”, “Luis”. Which of the following statements will cause an error to occur? I. list.set(2, “6”); II. list.add(4, “Steven”); III. String s = list.get(4);
Back
III only
5.
FLASHCARD QUESTION
Front
Consider a Monster class that has a default constructor. Suppose a list ArrayList<Monster> minions is initialized. Which of the following will not cause an IndexOutOfBoundsException to be thrown?
Options:
for(int i = 0; i <= minions.size(); i++) minions.set(i, new Monster());
minions.add(minions.size(), new Monster());
Monster m = minions.get(minions.size());
Monster m = minions.remove(minions.size());
minions.add(-1, new Monster());
Back
minions.add(minions.size(), new Monster());
6.
FLASHCARD QUESTION
Front
A sorted list of 200 integers is to be searched to determine whether the value of 150 is in the list. What is the most efficient sorting algorithm to use in this case and what is the maximum number of elements that would be examined?
Back
Binary Search, 8 times
7.
FLASHCARD QUESTION
Front
What element will be contained in nums[2] after executing the shuffle algorithm on the array nums = 8, 7, 6, 5, 4 with rand values 3, 2, 0, 0?
Back
8
Create a free account and access millions of resources
Similar Resources on Wayground
24 questions
Sets and Real Numbers

Flashcard
•
9th Grade - University
19 questions
AIIMS Review!

Flashcard
•
12th Grade
20 questions
Computer Science Unit 9

Flashcard
•
12th Grade
18 questions
Pronoun-Antecedent Agreement ACT Prep

Flashcard
•
10th - 12th Grade
25 questions
Indefinite Pronouns page 55 grammar book

Flashcard
•
9th - 10th Grade
40 questions
AP CSA Unit 4 Review

Flashcard
•
11th Grade
28 questions
Pseudocode Pretest 24-25

Flashcard
•
11th Grade
29 questions
24-25 csp fall exam

Flashcard
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade