
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
29 questions
24-25 csp fall exam

Flashcard
•
9th - 12th Grade
21 questions
Python Functions

Flashcard
•
12th Grade
23 questions
Array & ArrayList Review

Flashcard
•
10th - 12th Grade
29 questions
Abstract Data Types

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

Flashcard
•
11th Grade
23 questions
CSP Unit 6 Review

Flashcard
•
12th Grade
25 questions
AP CSP Exam Reference Sheet Practie

Flashcard
•
12th Grade
28 questions
P5.js Advanced

Flashcard
•
9th - 12th Grade
Popular Resources on Wayground
55 questions
CHS Student Handbook 25-26

Quiz
•
9th Grade
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
10 questions
Chaffey

Quiz
•
9th - 12th Grade
15 questions
PRIDE

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
22 questions
6-8 Digital Citizenship Review

Quiz
•
6th - 8th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Chaffey

Quiz
•
9th - 12th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Lab Safety and Lab Equipment

Quiz
•
9th - 12th Grade
20 questions
Getting to know YOU icebreaker activity!

Quiz
•
6th - 12th Grade
12 questions
Macromolecules

Lesson
•
9th - 12th Grade
12 questions
Classifying Polys - 1.1

Quiz
•
10th - 12th Grade
10 questions
Solving Equations Opener

Quiz
•
11th Grade