CS2 chapter 8

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

search

A ________ algorithm is a method of locating a specific item of information in a larger collection of data.

sorted

Array elements must be ________ before a binary search can be performed.

None of these

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

from lowest to highest value

Data that is sorted in ascending order is ordered ________.

linear search

The ________ is adequate for searching through small arrays.

selection, bubble

The ________ sort usually performs fewer exchanges than the ________ sort.

simplicity

The advantage of a linear search is its ________.

descending

When an array is sorted from highest to lowest, it is said to be in ________ order.

middle

A binary search begins with the ________ element of an array.

binary, linear

A(n) ________ search is more efficient than a ________ search.

linear

A(n) ________ search uses a loop to sequentially step through an array.

False

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

False

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

False

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

True

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.

False

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

True

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

False

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

20,000

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.

Sorting

________ algorithms are used to arrange random data into some order.


Kaugnay na mga set ng pag-aaral

Chapter 56: Acute Intracranial Problems

View Set

IMMUNIZATION AND HEALTH PROMOTION PEDS EXAM 1.

View Set

Archer Maternal & Newborn Health

View Set