Introduction to Computer Programming Final Exam

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

B. linear search

The _________ is adequate for searching through small arrays. A. binary search B. linear search C. bubble sort D. unary search E. None of these

B. binary, linear

The _________ sort usually performs fewer exchanges than the ________ sort. A. selection, bubble B. binary, linear C. None of these D. ANSI, ASCII E. bubble, selection

B. simplicity

The advantage of a linear search is its ____________. A. None of these B. simplicity C. speed D. complexity E. efficiency

False

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

E. Sorting

___________ algorithms are used to arrange random data into some order. A. Linear B. None of these C. Binary search D. Standard search E. Sorting

A. search

A ________ algorithm is a method of locating a specific item of information in a larger collection of data. A. search B. standard C. sort D. None of these E. linear

B. middle

A binary search begins with the _________ element of an array. A. first B. middle C. last D. None of these E. largest

False

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

A. binary, linear

A(n) ________ search is more efficient than a(n) ________ search A. binary, linear B. integer, double C. None of these D. linear, binary E. character, string

E. linear

A(n) ________ search uses a loop to sequentially step through an array. A. binary B. None of these C. relative D. unary E. linear

C. sorted

Array elements must be _________ before a binary search can be performed. A. set to zero B. summed C. sorted D. positive numbers E. None of these

False

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

False

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

C. from lowest to highest value

Data that is sorted in ascending order is ordered A. None of these B. from highest to lowest value C. from lowest to highest value D. always with a binary sort algorithm E. always with a linear sort algorithm

True

In the average case, an item is just as likely to be found near the beginning of an array as near the end. True False

D. None of these

Regardless of the algorithm being used, a search through an array is always performed A. beginning with the middle element B. from lowest to highest element C. from highest to lowest element D. None of these E. using a binary search

True

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

False

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

A. 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. A. 20,000 B. 2000 C. None of these D. only half E. only the first

D. descending

When an array is sorted from highest to lowest, it is said to be in _____ order. A. None of these B. reverse C. forward D. descending E. ascending


Set pelajaran terkait

oth3416: the ultimate exam 2 mega-quizlet

View Set

Inv - Type/Char Cash Equivalents (1)

View Set

Chapter 9: nail structure and growth

View Set

Finance Final, Fk Pirim (Exams1-3)

View Set

JavaScript Objects and Prototypes

View Set