• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 1 out of 2 pages
Exam (elaborations)

AP Computer Science Principles Mid-Term Exam Review Binary Search Actual Questions And Correct Detailed Answers Guaranteed Pass.

Document preview thumbnail
Preview 1 out of 2 pages

A sorted list of numbers contains 200 elements. Which of the following is closest to the maximum number of list elements that will need to be examined when performing a binary search for a particular value in the list? A. 5 B. 8 C. 100 D. 200 - correct answer B. 8 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? A. 10 B. 15 C. 5,000 D. 10,000 - correct answer B. 15 The list listOne is a sorted list of numbers that contains 700 elements. The list listTwo is a sorted list of numbers that contains 900 elements. Let x represent the maximum number of list elements that will need to be examined when performing a binary search for a value in listOne, and let y represent the maximum number of list elements that will need to be examined when performing a binary search for a value in listTwo. Which of the following statements about x and y is true? A. The value of x is approximately equal to the value of y. B. The value of x is approximately 10 less than the value of y. C. The value of x is approximately 13 less than the value of y. D. The value of x is approximately 200 less than the value of y. - correct answer A. The value of x is approximately equal to the value of y. For which of the following lists can a binary search be used to search for an item in the list? ["blue", "green", "jade", "mauve", "pink"] [5, 5, 5, 5, 6, 7, 8, 8, 8] [10, 5, 3, 2, -4, -8, -9, -12] A. I only B. III only C. I and III only D. I, II, and III - correct answer D. I, II, and III A large number of genetic codes are stored as binary values in a list. Which one of the following conditions must be true in order for a researcher to obtain the correct result when using a binary search algorithm to determine if a given genetic code is in the list? A. The genetic codes must be converted from binary to decimal numbers. B. The list must be sorted based on the genetic code values. C. The number of genetic code values in the list must be a power of 2. D. The number of genetic code values in the list must be even. - correct answer B. The list must be sorted based on the genetic code values. Suppose that a list of numbers contains values [-4, -1, 1, 5, 2, 10, 10, 15, 30]. Which of the following best explains why a binary search should NOT be used to search for an item in this list? A. The list contains both positive and negative elements. B. The elements of the list are not sorted. C. The list contains an odd number of elements. D. The list contains duplicate elements. - correct answer B. The elements of the list are not sorted.


Document information

Uploaded on
July 30, 2024
Number of pages
2
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers
$12.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Rechga
5.0
(10)
Sold
20
Followers
2
Items
2424
Last sold
2 months ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions

Whoops! We can’t load your doc right now. Try again or contact support.