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?
AP CSP Algorithms & Programming (College Board Style)

Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Jody Bird
Used 67+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
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!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 nn people, which requires that up to n entries be examined.
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which of the following is a benefit of using a list as a data abstraction in a program?
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.
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
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 ?
number
string
lsit
boolean
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
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 ?
"e"
"f"
"h"
"i"
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
A time stamp indicates the date and time that a measurement was taken. 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?
15
10
5000
10,000
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
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
Making the code run faster
Providing more opportunities for code reuse
Reducing the amount of duplicated code
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
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
Create a free account and access millions of resources
Similar Resources on Quizizz
18 questions
MYP Command Terms For Design

Quiz
•
6th - 12th Grade
18 questions
Algorithms

Quiz
•
11th Grade
20 questions
Ch6 ICT Applications IGCSE 0417

Quiz
•
9th - 12th Grade
15 questions
Types of Software

Quiz
•
11th - 12th Grade
18 questions
Search & Sort Algorithms

Quiz
•
7th - 11th Grade
10 questions
GCSE Computer Science 9-1: Sorting Algorithms

Quiz
•
10th Grade - University
15 questions
Multimedia

Quiz
•
8th - 9th Grade
15 questions
AS Computing: Data Structures

Quiz
•
10th Grade - University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University