C++ Chapter 8
search
A ________ algorithm is a method of locating a specific item of information in a larger collection of data. sort search standard linear None of these
binary, linear
A ________ search is more efficient than a ________ search. character, string integer, double binary, linear linear, binary None of these
middle
A binary search begins with the ________ element of an array. first last largest middle None of these
sorted
Array elements must ________ before a binary search can be performed. summed set to zero positive integers sorted None of these
False
Before you can perform a bubble sort, the data must be stored in descending order. T or F
False
Binary search is also called as "sequential search"? T or F
False
Bubble sort is very efficient for large arrays. T or F
True
If you are using the bubble sort algorithm to sort an array in descending order, the smaller values move toward the end. T or F
True
Powers of 2 are used to calculate the maximum number of comparisons the binary search will make on an array of any size. T or F
True
The average number of comparisons performed by the linear search on an array of N elements is N/2 (assuming the search values are consistently found).
True
The binary search is much more efficient than the linear search. T or F
10
What is the maximum number of comparisons that a binary search function will make when searching for a value in a 1,000 element array? 1001 1000 10 11
1000
What is the maximum number of comparisons that a linear search function will make when searching for a value in a 1,000 element array and it fails to locate that item? 1000 1001 999 10
False
The linear search repeatedly divides the portion of an array being searched in half. T or F
False
The maximum number of comparisons performed by the linear search on an array of N elements is N/2 (assuming the search values are consistently found). T or F