

APCSA MCQPacket Unit 7-10
Flashcard
•
Computers
•
11th Grade
•
Practice Problem
•
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
33 questions
Means of transport Flashcards
Flashcard
•
10th Grade
27 questions
Stakeholder Theory and Stakeholders
Flashcard
•
11th Grade
29 questions
Setting Goals for Success
Flashcard
•
12th Grade
19 questions
Class X History Ch-1 Nationalism in India
Flashcard
•
10th Grade
23 questions
Measures of Variability
Flashcard
•
12th Grade
35 questions
2425 F6 Mock P1A (Modified v1)
Flashcard
•
12th Grade
33 questions
CCEA GCSE Spanish Context 3 Vocabulary
Flashcard
•
10th Grade
22 questions
Chapter 18: Work, Employment and Volunteerism
Flashcard
•
12th Grade
Popular Resources on Wayground
8 questions
Spartan Way - Classroom Responsible
Quiz
•
9th - 12th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
14 questions
Boundaries & Healthy Relationships
Lesson
•
6th - 8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
3 questions
Integrity and Your Health
Lesson
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
9 questions
FOREST Perception
Lesson
•
KG
20 questions
Main Idea and Details
Quiz
•
5th Grade