COP2000 Chapter 8
Using a linear search to find a value that is stored in the last element of an array that contains 20,000 elements, ________ elements must be compared.
20,000
The following function should swap the values contained in two integer variables, num1 and num2. What, if anything, is wrong with this function?
The swap function must use reference parameters.
The following is the pseudocode for which type of algorithm?
binary search
A ________ search is more efficient than a ________ search.
binary, linear
When an array is sorted from highest to lowest, it is said to be in
descending order
Data that is to be sorted in ascending order is ordered
from lowest value to highest value
Algorithms used to arrange random data in some order are ________ algorithms.
sorting
A ________ algorithm is a method of locating a specific item of information in a larger collection of data.
search
The following is the pseudocode for which type of algorithm?
selection sort
The ________ sort usually performs fewer exchanges than the ________ sort.
selection, bubble