Exam 16: Searching and Sorting

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

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

(Multiple Choice)
4.7/5
(31)

If you initially declare a vector object and do not specify its size, then in order to add elements to the vector object, we use the function ____________________.

(Short Answer)
4.9/5
(38)

The bubble sort makes fewer item assignments than comparisons.

(True/False)
4.9/5
(33)

The statement ____ creates the vector object vecList of size size.

(Multiple Choice)
4.8/5
(33)

When moving array values for insertion sort, to move list[4] into list[2], first ____.

(Multiple Choice)
4.8/5
(36)

In the insertion sort function, the variable firstOutOfOrder is initialized to ____, assuming n is the length of the list.

(Multiple Choice)
4.9/5
(31)

The type vector provides the expression ____________________, which returns the last element of the object.

(Short Answer)
4.9/5
(26)

The type vector provides the expression ____________________, which inserts a copy of elem into vecList at the end.

(Short Answer)
4.9/5
(33)

During the sorting phase of insertion sort, the array containing the list is divided into two sublists, sorted and unsorted.

(True/False)
4.7/5
(38)

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

(Multiple Choice)
4.9/5
(44)

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

The type vector provides the expression ____________________, which returns true if the object vecList is empty and false otherwise.

(Short Answer)
4.9/5
(36)

For sorting a list of length n, bubble sort uses ____ iterations.

(Multiple Choice)
4.9/5
(35)

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

(Multiple Choice)
4.8/5
(34)

The sequential search algorithm does not assume that the list is sorted.

(True/False)
4.9/5
(37)

The type vector provides the function ____________________, which deletes all elements from the object.

(Short Answer)
4.7/5
(40)

In order to apply a(n) ____________________ search, the list must be sorted.

(Short Answer)
4.8/5
(42)

The type vector provides the expression ____________________, which deletes the last element of vecList.

(Short Answer)
4.9/5
(31)

The first element in a vector object is at location ____________________.

(Short Answer)
4.7/5
(36)

The type vector provides the expression ____________________, which returns the maximum number of elements that can be inserted into the object vecList.

(Short Answer)
4.8/5
(43)
Showing 21 - 40 of 46
close modal

Filters

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