CS2 Chapter 8

25 July 2022
4.7 (114 reviews)
23 test answers

Unlock all answers in this set

Unlock answers (19)
question
Sorting
answer
________ algorithms are used to arrange random data into some order.
question
linear search
answer
The ________ is adequate for searching through small arrays.
question
simplicity
answer
The advantage of a linear search is its ________.
question
20,000
answer
Using a linear search to find a value that is stored in the last element of an array of 20,000 elements, ________ element(s) must be compared.
question
sorted
answer
Array elements must be ________ before a binary search can be performed.
question
None of these
answer
Regardless of the algorithm being used, a search through an array is always performed ________. from lowest to highest element from highest to lowest element beginning with the middle element using a binary search
question
middle
answer
A binary search begins with the ________ element of an array.
question
linear
answer
A(n) ________ search uses a loop to sequentially step through an array.
question
search
answer
A ________ algorithm is a method of locating a specific item of information in a larger collection of data.
question
descending
answer
When an array is sorted from highest to lowest, it is said to be in ________ order.
question
binary, linear
answer
A(n) ________ search is more efficient than a ________ search.
question
from lowest to highest value
answer
Data that is sorted in ascending order is ordered ________.
question
selection, bubble
answer
The ________ sort usually performs fewer exchanges than the ________ sort.
question
False
answer
True/False: Before you can perform a selection sort, the data must be stored in ascending order.
question
False
answer
True/False: A linear search can only be implemented with integer values.
question
False
answer
True/False: Before you can perform a bubble sort, the data must be stored in descending order.
question
False
answer
True/False: The bubble sort is an easy way to arrange data into ascending order, but it cannot arrange data into descending order.
question
False
answer
True/False: Before you can perform a selection sort, the data must be stored in ascending order.
question
True
answer
True/False: The number of comparisons made by a binary search is expressed in powers of two.
question
False
answer
True/False: A linear search can only be implemented with integer values.
question
False
answer
True/False: Using a binary search, you are more likely to find an item than if you use a linear search.
question
False
answer
True/False: Before you can perform a bubble sort, the data must be stored in descending order.
question
True
answer
True/False: In the average case, an item is just as likely to be found near the beginning of an array as near the end.