Exam 9: Searching, Sorting, and Algorithm Analysis

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

The sort usually performs more exchanges than the sort.

Free
(Multiple Choice)
4.9/5
(40)
Correct Answer:
Verified

C

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

Free
(Multiple Choice)
4.8/5
(40)
Correct Answer:
Verified

E

If the item being searched for is not in the array, binary search stops looking for it and reports that it is not there when

Free
(Multiple Choice)
5.0/5
(33)
Correct Answer:
Verified

B

To locate a value in an ordered array of 50 items, binary search must examine at most values.

(Multiple Choice)
4.9/5
(33)

A sorting algorithm can be used to arrange a set of in order.

(Multiple Choice)
4.8/5
(42)

If algorithm A requires 2n + 1 basic operations to process an input of size n, and Algorithm B requires 3n + 2 basic operations to process the same input, algorithm A is considered to be more efficient than Algorithm B.

(True/False)
4.7/5
(43)

When sorting an array of objects, if the values in the data member being sorted on are out of order for two objects, it is necessary to

(Multiple Choice)
4.8/5
(31)

Any sorting algorithm, such as bubble sort or selection sort, that can be used on data stored in an array can also be used on data stored in a vector.

(True/False)
4.7/5
(34)

If a binary search is used to search for the number 4 in the 11- element array shown below, which value will the 4 be compared to first? If a binary search is used to search for the number 4 in the 11- element array shown below, which value will the 4 be compared to first?

(Multiple Choice)
4.9/5
(34)

A ________search uses a loop to sequentially step through an array.

(Multiple Choice)
4.9/5
(39)

To determine that a value is not present in an unordered array of 50 items, linear search must examine an average of values.

(Multiple Choice)
4.8/5
(25)

When searching for an item in an unordered set of data, binary search can find the item more quickly than linear search.

(True/False)
4.7/5
(28)

When searching for a particular object in an array of objects, it is necessary to compare the to the value in each examined object's

(Multiple Choice)
4.7/5
(41)

A(n)algorithm arranges data into some order.

(Multiple Choice)
4.7/5
(37)

The linear search is adequate for searching through arrays, but not through ones.

(Multiple Choice)
4.8/5
(34)

Selection sort requires passes to put n data items in order.

(Multiple Choice)
4.9/5
(41)

Sorted data can be ordered

(Multiple Choice)
4.8/5
(43)

When sorting an array of objects, if the values in the data member being sorted on are out of order for two objects, those two data values should be swapped.

(True/False)
4.8/5
(32)

We can measure the complexity of an algorithm that solves a computational problem by determining the number of for an input of size n.

(Multiple Choice)
4.9/5
(32)

To find a value that is in an unordered array of 100 items, linear search must examine an average of values.

(Multiple Choice)
4.7/5
(30)
Showing 1 - 20 of 36
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)