Exam 9: Searching, Sorting, Algorithm Analysis

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

A binary search begins by examining the ________ element of an array.

(Multiple Choice)
4.9/5
(34)

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, algorithms A and B are considered to be equally efficient.

(True/False)
4.7/5
(26)

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

(Multiple Choice)
4.8/5
(38)

If a selection sort is used to arrange the numbers 7 5 3 9 2 6 in ascending order, what order will the data be in after the first pass?

(Multiple Choice)
4.9/5
(33)

To find a value in an ordered array of 100 items, how many values must binary search examine at most?

(Multiple Choice)
4.7/5
(31)

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

(True/False)
4.8/5
(25)

To determine that an item is not in an unordered array of 100 items, how many values must linear search examine on average?

(Multiple Choice)
4.8/5
(32)

When sorting an array of objects or structures, one must decide which data item to sort on.

(True/False)
4.9/5
(36)

A binary search requires that the elements be in order.

(True/False)
4.9/5
(38)

If a selection sort is used to arrange the numbers 8 6 4 9 3 7 in ascending order, what order will the data be in after the first pass of the sort is completed?

(Multiple Choice)
4.7/5
(34)

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

(Multiple Choice)
4.7/5
(27)

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

(Multiple Choice)
4.8/5
(35)

To find a value that is in an unordered array of 50 items, how many values must linear search examine on average?

(Multiple Choice)
4.8/5
(36)

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

(Multiple Choice)
4.9/5
(40)

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.8/5
(30)

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

(Multiple Choice)
4.8/5
(31)

If a bubble sort is used to arrange the numbers 8 6 4 9 3 7 in ascending order, what order will the data be in after the first pass of the sort is completed?

(Multiple Choice)
4.7/5
(28)

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

(Multiple Choice)
4.8/5
(41)

If a binary search is used to search for the number 4 in the 11-element array shown here int A[] = {1, 2, 3, 4, 6, 7, 8, 9, 10, 12, 17}; Which value will the 4 be compared to first?

(Multiple Choice)
4.8/5
(33)

If a bubble sort is used to arrange the numbers 7 5 3 9 2 6 in ascending order, what order will the data be in after the first pass?

(Multiple Choice)
4.8/5
(25)
Showing 21 - 40 of 40
close modal

Filters

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