Question 1
Questions refer to the Hi-Lo game described below. Consider the problem of writing a Hi-Lo game in which a user thinks of an integer from 1 to 100 inclusive and the computer tries to guess that number. Each time the computer makes a guess, the user makes one of three responses: “lower” (i.e., the number is lower than the computer’s guess) “higher” (i.e., the number is higher than the computer’s guess) “you got it in < however many > tries! ” Suppose the game is programmed so that the computer uses a binary search strat- egy for making its guesses. What is the maximum number of guesses the com- puter could make before guessing the user’s number?
Correct Answer:
7
Explanation:
Correct answer: 7
Question 2
Consider a binary search algorithm to search an ordered list of numbers. Which of the following choices is closest to the maximum number of times that such an algorithm will execute its main comparison loop when searching a list of 1 million numbers?
Correct Answer:
20
Explanation:
Correct answer: 20
Question 3
A binary search is to be performed on an array with 600 elements. In the worst case, which of the following best approximates the number of iterations of the algorithm?
Correct Answer:
10
Explanation:
Correct answer: 10
Question 4
Assume that mergesort will be used to sort an array arr of n integers into increas- ing order. What is the purpose of the merge method in the mergesort algorithm?
Correct Answer:
Merge two sorted parts of arr into a single sorted array.
Explanation:
Correct answer: Merge two sorted parts of arr into a single sorted array.
Question 5
The array names[0], names[1], . . . , names[9999] is a list of 10,000 name strings. The list is to be searched to determine the location of some name X in the list. Which of the following preconditions is necessary for a binary search?
Correct Answer:
The list is in alphabetical order.
Explanation:
Correct answer: The list is in alphabetical order.
Question 1
Exam overview

About this Exam

Prepare with the AP CSP Practice Test - Unit 10 Recursion practice quiz. This question bank includes 24 questions covering return, method, high, array, and public. Use it to review important concepts, identify knowledge gaps, and build confidence for the related exam, course, or assessment.

More details

Additional Information

AP CSP Practice Test - Unit 10 Recursion

This practice set contains 24 questions from the matching question bank and focuses on return, method, high, array, and public. Work through each question carefully, review the provided solutions, and revisit topics that need more study before your next attempt.

This is an independent study resource intended for practice and review; it is not an official examination or an endorsement by any organization named in the title.

Quiz information

Frequently Asked Questions

The complete question count is available after full access is unlocked.
No fixed duration is currently configured for this quiz.
Question explanations are included where they are available in the quiz content, helping you review the reasoning after answering.
Yes. You can retake the practice test again as you continue studying during your available access period.
After your access is confirmed, you can continue into the complete practice exam from this quiz flow.
Unless explicitly stated otherwise, this page provides independent practice material for study and exam preparation and is not the official examination itself.
Keep studying

Related Questions