Chapter 8

¡Supera tus tareas y exámenes ahora con Quizwiz!

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


Conjuntos de estudio relacionados

5.1 Entities, relationships, and attributes

View Set

Ethical Hacking Practice Midterm

View Set

Unit 9 Respiratory Prep U Questions

View Set

Chapter 22: Descent with Modification: A Darwinian View of Life

View Set

STS - Chapter 1 (Historical Antecedents in the Course of Science and Technology)

View Set

MKT/421T: Marketing Wk 4 - Practice: Ch. 13, Building the Price Foundation [due Day 5]

View Set