Chapter 8
A ________ algorithm is a method of locating a specific item of information in a larger collection of data.
search
The ________ sort usually performs fewer exchanges than the ________ sort.
selection, bubble
The advantage of a linear search is its
simplicity
Algorithms used to arrange random data in some order are ________ algorithms.
sorting
What is the output after the following code executes?int numerator = 5;int denominator = 25;int temp = 0;temp = numerator;numerator = denominator;denominator = temp;cout << numerator << "/" << denominator << " = " <<(numerator/denominator) << endl;
25/5 = 5
The following function should swap the values contained in two integer variables, num1 and num2. What, if anything, is wrong with this function?void swap(int num1, int num2){int temp = num2;num2 = num1;num1 = temp;}
The swap function must use reference parameters
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
A(n) ________ search uses a loop to sequentially step through an array.
linear
Data that is to be sorted in ascending order is ordered
low - high
A binary search begins with the ________ element of an array.
middle
The ________ is adequate for searching through small arrays.
the linear search