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
(35)
Correct Answer:
Verified

A

In the average case,sequential search typically searches ____.

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

C

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

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

True

A comparison tree is a(n)____________________ tree.

(Short Answer)
4.8/5
(25)

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

(True/False)
4.8/5
(35)

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

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

(True/False)
4.9/5
(32)

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

(Multiple Choice)
4.7/5
(35)

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

(Short Answer)
4.8/5
(44)

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
(39)

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

(Multiple Choice)
4.9/5
(42)

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

(Multiple Choice)
4.8/5
(36)

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
(38)

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

(Multiple Choice)
4.9/5
(44)

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

(Multiple Choice)
4.9/5
(43)

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

(Multiple Choice)
4.9/5
(41)

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

(True/False)
4.8/5
(38)

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
(51)

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

(Multiple Choice)
4.9/5
(39)

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

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

Filters

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