Exam 18: Searching and Sorting Algorithms

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

After the second iteration of bubble sort for a list of length n,the last ____ elements are sorted.

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

A

In the average case,sequential search typically searches ____.

Free
(Multiple Choice)
4.7/5
(70)
Correct Answer:
Verified

C

The sequential search algorithm does not require that the list be sorted.

Free
(True/False)
4.8/5
(88)
Correct Answer:
Verified

True

A comparison tree is a(n)____________________ tree.

(Short Answer)
4.9/5
(65)

During the second iteration of a selection sort,the smallest item is moved to the top of the list.

(True/False)
4.7/5
(86)

Any sorting algorithm that sorts a list of n distinct elements by comparison of the keys only,in its worst case,makes at least ____________________ key comparisons.

(Short Answer)
4.8/5
(78)

If n = 1000,then to sort the list,selection sort makes about 50,000 key comparisons.

(True/False)
4.9/5
(79)

For a list of length n,selection sort makes ____ item assignments.

(Multiple Choice)
4.7/5
(72)

In a quick sort,all of the sorting work is done by the function ____________________.

(Short Answer)
4.7/5
(87)

The first step in the quick sort partition algorithm is to determine the ____________________ and swap it with the first element in the list.

(Short Answer)
4.9/5
(74)

The formula to find the index of the middle element of a list is ____.

(Multiple Choice)
4.9/5
(96)

____ sort requires knowing where the middle element of the list is.

(Multiple Choice)
4.8/5
(79)

In a bubble sort,the smaller elements move toward the bottom,and the larger elements move toward the top of the list.

(True/False)
4.9/5
(83)

In a bubble sort for list of length n,the first step is to compare elements ____.

(Multiple Choice)
4.9/5
(96)

The sequential search algorithm uses a(n)____ variable to track whether the item is found.

(Multiple Choice)
4.9/5
(97)

If n = 1000,to sort the list,bubble sort makes about ____ item assignments.

(Multiple Choice)
4.9/5
(82)

The selection sort algorithm finds the location of the smallest element in the unsorted portion of the list.

(True/False)
4.8/5
(78)

In the case of an unsuccessful search,it can be shown that for a list of length n,a binary search makes approximately ____________________ key comparisons.

(Short Answer)
4.9/5
(95)

We can trace the execution of a comparison-based algorithm by using a graph called a ____.

(Multiple Choice)
4.9/5
(92)

A sequence of branches in a comparison tree is called a(n)____________________.

(Short Answer)
4.8/5
(81)
Showing 1 - 20 of 50
close modal

Filters

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