Solved

Which of the Following Statements About the Binary Search of an Array

Question 2

Multiple Choice

Which of the following statements about the binary search of an array in ascending order is false?


A) In the worst-case scenario, searching a sorted array of 1023 elements takes only 10 comparisons when using a xe "binary search:algorithm"bxe "efficiency of:binary search"inary search. The number 1023 (which is 210 - 1) is divided by 2 only 10 times to get the value 0, which indicates that there are no more elements to test.
B) Dividing by 2 is equivalent to one comparison in the binary search algorithm. Thus, an array of 1,048,575 (220 - 1) elements takes a maximum of 20 comparisons to find the key, and an array of about one billion elements takes a maximum of 30 comparisons to find the key. This is a tremendous performance improvement over the xe "linear search algorithm"linear search.
C) For a one-billion-element array, the increase in performance of a binary search over a linear search is a difference between an average of five million comparisons for the linear search and a maximum of only 30 comparisons for the binary search!
D) The binary search's big O is xe "Big O notation"O(log n) , which also is known as logarithmic run time and pronounced as "order log n." Of course, this assumes the array is sorted, though, which could take substantial time.

Correct Answer:

verifed

Verified

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents