For which of the following situations would it be best to use a heuristic in order to find a solution that runs in a reasonable amount of time?
- Appending a value to a list of n elements, which requires no list elements be examined.
- Finding the fastest route that visits every location among n locations, which requires n! possible routes be examined.
- Performing a binary search for a score in a sorted list of n scores, which requires that fewer than n scores be examined.
- Performing a linear search for a name in an unsorted database of n people, which requires that up to n entries be examined.
AP CSP Algorithms & Programming (College Board Style)

Flashcard
•
Computers
•
9th - 12th Grade
•
Hard
Quizizz Content
FREE Resource
Student preview

14 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Back
Finding the fastest route that visits every location among n locations, which requires n! possible routes be examined.
2.
FLASHCARD QUESTION
Front
Which of the following is a benefit of using a list as a data abstraction in a program?
Options:
Lists often allow their size to be easily updated to hold as many data values as needed.
Lists convert all elements to strings so that they can be inspected character-by-character.
Lists prevent duplicate data values from appearing in the list.
Lists are used to store all input data so that there is a running record of all user input.
Back
Lists often allow their size to be easily updated to hold as many data values as needed.
3.
FLASHCARD QUESTION
Front
The variable isOpen is to be used to indicate whether or not a store is currently open. Which of the following is the most appropriate data type for isOpen ?
Back
boolean
4.
FLASHCARD QUESTION
Front
Assume that both lists and strings are indexed starting with index 1. The list wordList has the following contents. ["abc", "def", "ghi", "jkl"] Let myWord be the element at index 3 of wordList. Let myChar be the character at index 2 of myWord. What is the value of myChar ?
Back
"h"
5.
FLASHCARD QUESTION
Front
A data scientist has a list containing 10,000 time stamps, sorted in chronological order. Which of the following is closest to the maximum number of values that will need to be examined when performing a binary search for a value in the list?
Back
15
6.
FLASHCARD QUESTION
Front
A computer science student completes a program and asks a classmate for feedback. The classmate suggests rewriting some of the code to include more procedural abstraction. Which of the following is NOT a benefit of procedural abstraction? Making the code more readable, Providing more opportunities for code reuse, Reducing the amount of duplicated code
Back
Making the code run faster
7.
FLASHCARD QUESTION
Front
The list wordList contains a list of 10 string values. Which of the following is a valid index for the list? -1, "hello", 1.25, 4
Back
4
Create a free account and access millions of resources
Similar Resources on Quizizz
9 questions
Unit 5 -- Lists, Loops, Traversals

Flashcard
•
9th - 12th Grade
13 questions
AP CSP Unit 7: Parameters, Returns, and Libraries

Flashcard
•
9th - 12th Grade
12 questions
Code.org Unit 6 Assessment Day

Flashcard
•
9th - 12th Grade
13 questions
Big Idea 2: Data Questions

Flashcard
•
9th - 12th Grade
13 questions
Big Idea 2: Data Questions

Flashcard
•
9th - 12th Grade
13 questions
Big Idea 2: Data Questions

Flashcard
•
9th - 12th Grade
12 questions
AP CSP Loops Practice

Flashcard
•
9th - 12th Grade
12 questions
Code.org - Unit 6 Lists, Loops, and Traversals

Flashcard
•
10th Grade - University
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade
Discover more resources for Computers
25 questions
Spanish preterite verbs (irregular/changed)

Quiz
•
9th - 10th Grade
10 questions
Identify Slope and y-intercept (from equation)

Quiz
•
8th - 9th Grade
10 questions
Juneteenth: History and Significance

Interactive video
•
7th - 12th Grade
8 questions
"Keeping the City of Venice Afloat" - STAAR Bootcamp, Day 1

Quiz
•
9th - 12th Grade
26 questions
June 19th

Quiz
•
4th - 9th Grade
20 questions
Distance, Midpoint, and Slope

Quiz
•
10th Grade
20 questions
Figurative Language Review

Quiz
•
10th Grade
27 questions
STAAR English 1 Review

Quiz
•
9th Grade