Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Login

Register Now

Welcome to All Test Answers

Chapter 08 Starting out with C++ Searching and Sorting Arrays


 

Download  file with the answers

Not a member!
Create a FREE account here to get access and download this file with answers


 

Chapter Eight

MULTIPLE CHOICE

1. A ________ algorithm is a method of locating a specific item of information in a larger collection of data.
a. sort
b. search
c. standard
d. linear
e. None of these

 

2. The advantage of a linear search is its ____________.
a. complexity
b. efficiency
c. simplicity
d. speed
e. None of these

 

3. A(n) ________ search is more efficient than a(n) ________ search
a. character, string
b. integer, double
c. binary, linear
d. linear, binary
e. None of these

 

4. A binary search begins with the _________ element of an array.
a. first
b. last
c. largest
d. middle
e. None of these

 

5. The _________ sort usually performs fewer exchanges than the ________ sort.
a. bubble, selection
b. binary, linear
c. selection, bubble
d. ANSI, ASCII
e. None of these

 

6. Array elements must be _________ before a binary search can be performed.
a. summed
b. set to zero
c. sorted
d. positive numbers
e. None of these

 

7. 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.
a. 20,000
b. only the first
c. only half
d. 2000
e. None of these

 

8. A(n) ________ search uses a loop to sequentially step through an array.
a. binary
b. unary
c. linear
d. relative
e. None of these

 

9. Data that is sorted in ascending order is ordered
a. from lowest to highest value
b. from highest to lowest value
c. always with a binary sort algorithm
d. always with a linear sort algorithm
e. None of these

 

10. Regardless of the algorithm being used, a search through an array is always performed
a. from lowest to highest element
b. from highest to lowest element
c. beginning with the middle element
d. using a binary search
e. None of these

 

11. When an array is sorted from highest to lowest, it is said to be in _____ order.
a. reverse
b. forward
c. descending
d. ascending
e. None of these

 

12. The _________ is adequate for searching through small arrays.
a. binary search
b. linear search
c. unary search
d. bubble sort
e. None of these

 

13. ___________ algorithms are used to arrange random data into some order.
a. Standard search
b. Linear
c. Sorting
d. Binary search
e. None of these

 

TRUE/FALSE

1. True/False: The bubble sort is an easy way to arrange data into ascending order, but it cannot arrange data into descending order.

2. True/False: The number of comparisons made by a binary search is expressed in powers of two.

3. 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.

4. True/False: A linear search can only be implemented with integer values.

5. True/False: Before you can perform a selection sort, the data must be stored in ascending order.

6. True/False: Before you can perform a bubble sort, the data must be stored in descending order.

7. True/False: Using a binary search, you are more likely to find an item than if you use a linear search.

About

Leave a reply

Captcha Click on image to update the captcha .

error: Content is protected !!